From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5404 invoked by alias); 27 Apr 2010 14:24:21 -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: 27927 Received: (qmail 12683 invoked from network); 27 Apr 2010 14:24:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Tue, 27 Apr 2010 16:24:01 +0200 From: Vincent Lefevre To: Peter Stephenson Cc: zsh-workers@zsh.org, 579209@bugs.debian.org Subject: Re: zsh: insert-last-word problem after completion Message-ID: <20100427142401.GE25015@prunille.vinc17.org> Mail-Followup-To: Peter Stephenson , zsh-workers@zsh.org, 579209@bugs.debian.org References: <20100426105331.GC25015@prunille.vinc17.org> <20100426131139.6e7311a7@csr.com> <20100426154210.GD25015@prunille.vinc17.org> <20100426233840.67d4934c@pws-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100426233840.67d4934c@pws-pc> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.20-6083-vl-r35499 (2010-04-24) On 2010-04-26 23:38:40 +0100, Peter Stephenson wrote: > There are two ways to approach this: either have the "&" inserted as > now, with the space removed, which is the same as if the "&" was typed; > or fix the suffix when inserting the last word. The drawback with the > former (which is what it's currently trying to do, but failing) is that > replacing the & with earlier words would leave the space before it > removed, and in most cases that won't be the right thing to do (you'd > get "my_echofalse" in this case). So I think the latter is the right > answer---we know that what we're inserting always functions as a > complete word, hence fixing the space or whatever makes more sense even > if in the case of the first last word you happen not to need it. > This happens to be the simpler fix (though I have an implementation of > the other one, too). Thanks, I confirm that this fixes the problem. > By the way, as an alternative to smart-insert-last-word, what I do is > have the widget copy-earlier-word bound to ESC = so that I can get > earlier words from the line to which ESC . has taken me. FYI, I was using smart-insert-last-word in the past, but it was too buggy (see the discussion in zsh-users in October 2006). I think that the problems have been resolved and I can reenable it... -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)