Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Modifiers, command position, and so forth (Re: Bug#519535: history expansion: modifier completion missing)
- X-seq: zsh-workers 26753
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: Modifiers, command position, and so forth (Re: Bug#519535: history expansion: modifier completion missing)
- Date: Wed, 18 Mar 2009 17:34:59 -0700
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <20090318193617.42747a6a@pws-pc>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090313105555.GA19025@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20090315062253.GB14010@xxxxxxxx> <20090316181852.27e9420d@news01> <090316194434.ZM16487@xxxxxxxxxxxxxxxxxxxxxx> <20090317095717.02bedf7e@news01> <090317114606.ZM17772@xxxxxxxxxxxxxxxxxxxxxx> <20090318193617.42747a6a@pws-pc>
On Wed, Mar 18, 2009 at 12:36 PM, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Tue, 17 Mar 2009 11:46:05 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> I guess I'm a little skeptical of the utility of this new option in
>> general. All the other modifiers do something "inside" the history
>> string, which would otherwise be difficult to do -- change case,
>> truncate, substitute, etc. This one is just prepending something in
>> a way that can already easily be done with $PWD/!$ (for example).
>
> If anything, the boot's on the other foot. Most of the other modifiers
> do simple string handling: find a fixed character, strip something off
> in front or behind. This one rationalises internal components and
> possibly resolves symbolic links.
The question isn't how much work it does, the question is how much
work it saves the user.
Consider that, in order to perform the operation "find a fixed
characeter, strip something off in front or behind" the user would
have to either:
-- retrieve the correct word from the history
-- store it in a variable
-- retype the command with a parameter substitution reference
Or, using the line editor, some variation of:
-- find, copy, and paste the word from the history
-- move to the character within the word
-- delete the appropriate substrings
The above as contrasted with typing !!:4:t:r (or whatever).
Compare this to to !!:4:a vs. $PWD/!!:4:t and you see what I'm getting
at. !!:4:A is a little different but it's still only $(pwd
-P)/!!:4:t. Yes, there's always MT1WTD any of the other history
operations as well (basename, dirname, sed, etc.), it's all a question
of degree of difficulty.
Throw in that I'd expect to encounter build problems with realpath()
somewhere, and I end up wondering whether the benefit is worth the
cost. That's all I'm saying.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author