From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 577 invoked by alias); 13 Jul 2014 22:50:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32858 Received: (qmail 3055 invoked from network); 13 Jul 2014 22:50:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 X-DKIM: Sendmail DKIM Filter v2.8.3 velox.its.uu.se A772A34D93 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uu.se; s=centralsmtp; t=1405291831; i=@uu.se; bh=SgSSyDUqFoeill180suTkVyJBC3mPOpxf12T/FMqcAM=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=gwe7Xod9kNfSeaBPP3xDRJu0VZUn518nCcWBmSMZ2cO96XEA9lGzxGmouztIM7Mu+ kVk6I0GJXXho3Xsfa16OtLX5JOkZ57sBZ3dJpO1PSZE4jE3SmAEzsine1I8ioP4ey2 qILWJrL0AKGw4REDNb5mfpQN/OWH6jDsZLbYTdRc= From: Emanuel Berg To: zsh-workers@zsh.org Subject: Re: implicit previous command, only state what should change References: <874myk3ocp.fsf@debian.uxu> <87sim4lwxk.fsf@ft.bewatermyfriend.org> Date: Mon, 14 Jul 2014 00:50:33 +0200 In-Reply-To: <87sim4lwxk.fsf@ft.bewatermyfriend.org> (Frank Terbeck's message of "Mon, 14 Jul 2014 00:24:07 +0200") Message-ID: <87sim427ra.fsf@debian.uxu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Bayes-Prob: 0.0063 (Score 0, tokens from: outbound, outbound-uu-se:default, uu-se:default, base:default, @@RPTN) X-p0f-Info: os=Linux 2.6.x, link=Ethernet or modem X-CanIt-Geo: ip=130.243.137.27; country=SE; region=Uppsala; city=Uppsala; latitude=59.8667; longitude=17.6333; http://maps.google.com/maps?q=59.8667,17.6333&z=6 X-CanItPRO-Stream: outbound-uu-se:outbound (inherits from outbound-uu-se:default,uu-se:default,base:default) X-Canit-Stats-ID: 0aMpWOwde - 163345679ab0 - 20140714 X-Antispam-Training-Forget: https://mailfilter.sunet.se/canit/b.php?i=0aMpWOwde&m=163345679ab0&t=20140714&c=f X-Antispam-Training-Nonspam: https://mailfilter.sunet.se/canit/b.php?i=0aMpWOwde&m=163345679ab0&t=20140714&c=n X-Antispam-Training-Spam: https://mailfilter.sunet.se/canit/b.php?i=0aMpWOwde&m=163345679ab0&t=20140714&c=s X-CanIt-Archive-Cluster: PfMRe/vJWMiXwM2YIH5BVExnUnw X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.36.171.202 Frank Terbeck writes: >> $ grep user-home-directory *.el >> >> After that, I realize that it should have been >> `user-emacs-directory'. >> >> Is there a way to tell zsh to "execute the previous >> command again, only substitute the first argument for >> user-emacs-directory"? Like >> >> $ !!:1->user-emacs-directory > > Like this: > > % ^-home-^-emacs- I seems that is substitution of the first match sort of like the sed substitution command without the g option, which actually for this example is much better than my suggestion (because only part of the argument is incorrect), so it is great to know, yes. Still, one can imagine a case when the whole argument is wrong, and for a long argument it would be better to just be able to refer to it and state the replacement. I tried ^!:1^replacement but that wasn't it. -- underground experts united