zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: zsh-workers@sunsite.dk
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	[thread overview]
Message-ID: <691a5d910903181734x5dbf4f14x9cb3e2721fbecc66@mail.gmail.com> (raw)
In-Reply-To: <20090318193617.42747a6a@pws-pc>

On Wed, Mar 18, 2009 at 12:36 PM, Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
> On Tue, 17 Mar 2009 11:46:05 -0700
> Bart Schaefer <schaefer@brasslantern.com> 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.


  reply	other threads:[~2009-03-19  0:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090313105555.GA19025@piper.oerlikon.madduck.net>
2009-03-15  6:22 ` Bug#519535: history expansion: modifier completion missing Clint Adams
2009-03-16 18:18   ` Peter Stephenson
2009-03-17  2:44     ` Bart Schaefer
2009-03-17  9:57       ` Peter Stephenson
2009-03-17 11:00         ` Peter Stephenson
2009-03-17 12:09           ` Peter Stephenson
2009-03-17 17:36         ` Bart Schaefer
2009-03-17 18:46         ` Modifiers, command position, and so forth (Re: Bug#519535: history expansion: modifier completion missing) Bart Schaefer
2009-03-18 19:36           ` Peter Stephenson
2009-03-19  0:34             ` Bart Schaefer [this message]
2009-03-19 14:34             ` Peter Stephenson
2009-03-19 15:28     ` Bug#519535: history expansion: modifier completion missing Mikael Magnusson
2009-03-19 16:09       ` Peter Stephenson
2009-03-19 16:18         ` Mikael Magnusson
2009-03-19 16:18       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=691a5d910903181734x5dbf4f14x9cb3e2721fbecc66@mail.gmail.com \
    --to=schaefer@brasslantern.com \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).