From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24532 invoked from network); 19 Mar 2009 00:35:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Mar 2009 00:35:21 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 7341 invoked from network); 19 Mar 2009 00:35:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Mar 2009 00:35:12 -0000 Received: (qmail 22529 invoked by alias); 19 Mar 2009 00:35:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26753 Received: (qmail 22511 invoked from network); 19 Mar 2009 00:35:05 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Mar 2009 00:35:05 -0000 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.238]) by bifrost.dotsrc.org (Postfix) with ESMTP id E0101801E289 for ; Thu, 19 Mar 2009 01:35:00 +0100 (CET) Received: by rv-out-0506.google.com with SMTP id g37so258025rvb.21 for ; Wed, 18 Mar 2009 17:34:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.141.115.20 with SMTP id s20mr445469rvm.255.1237422899190; Wed, 18 Mar 2009 17:34:59 -0700 (PDT) In-Reply-To: <20090318193617.42747a6a@pws-pc> References: <20090313105555.GA19025@piper.oerlikon.madduck.net> <20090315062253.GB14010@scru.org> <20090316181852.27e9420d@news01> <090316194434.ZM16487@torch.brasslantern.com> <20090317095717.02bedf7e@news01> <090317114606.ZM17772@torch.brasslantern.com> <20090318193617.42747a6a@pws-pc> Date: Wed, 18 Mar 2009 17:34:59 -0700 Message-ID: <691a5d910903181734x5dbf4f14x9cb3e2721fbecc66@mail.gmail.com> Subject: Re: Modifiers, command position, and so forth (Re: Bug#519535: history expansion: modifier completion missing) From: Bart Schaefer To: Peter Stephenson Cc: zsh-workers@sunsite.dk Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.92.1/9132/Wed Mar 18 21:46:20 2009 on bifrost X-Virus-Status: Clean On Wed, Mar 18, 2009 at 12:36 PM, Peter Stephenson wrote: > On Tue, 17 Mar 2009 11:46:05 -0700 > Bart Schaefer wrote: >> I guess I'm a little skeptical of the utility of this new option in >> general. =A0All the other modifiers do something "inside" the history >> string, which would otherwise be difficult to do -- change case, >> truncate, substitute, etc. =A0This 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. =A0Most of the other modifiers > do simple string handling: find a fixed character, strip something off > in front or behind. =A0This 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.