From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25443 invoked from network); 8 Sep 2004 21:24:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Sep 2004 21:24:11 -0000 Received: (qmail 54124 invoked from network); 8 Sep 2004 21:24:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Sep 2004 21:24:05 -0000 Received: (qmail 7065 invoked by alias); 8 Sep 2004 21:23:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20336 Received: (qmail 7055 invoked from network); 8 Sep 2004 21:23:53 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Sep 2004 21:23:53 -0000 Received: (qmail 53752 invoked from network); 8 Sep 2004 21:22:53 -0000 Received: from homer.w3.org (128.30.52.30) by a.mx.sunsite.dk with SMTP; 8 Sep 2004 21:22:52 -0000 Received: from jibboom (localhost [127.0.0.1]) by homer.w3.org (Postfix) with ESMTP id F03F84EEEA; Wed, 8 Sep 2004 17:22:49 -0400 (EDT) Received: by jibboom (Postfix, from userid 1000) id 7B1DB12BED; Wed, 8 Sep 2004 23:22:49 +0200 (CEST) Date: Wed, 8 Sep 2004 23:22:49 +0200 From: Hugo Haas To: Clint Adams Cc: zsh-workers@sunsite.dk, 270632-quiet@bugs.debian.org Subject: Re: Bug#270632: zsh: Completion and spaces Message-ID: <20040908212249.GE2775@larve.net> References: <20040908115321.GA2417@larve.net> <20040908180950.GC25987@scowler.net> <20040908194101.GD2775@larve.net> <20040908202633.GA3130@scowler.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="NtwzykIc2mflq5ck" Content-Disposition: inline In-Reply-To: <20040908202633.GA3130@scowler.net> User-Agent: Mutt/1.5.6+20040818i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.9 required=6.0 tests=BAYES_30 autolearn=no version=2.63 X-Spam-Hits: -0.9 --NtwzykIc2mflq5ck Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Clint Adams [2004-09-08 16:26-0400] > > Oh, you're right. It's not insert-last-word which is the culprit, but > > smart-insert-last-word. > >=20 > > I have done: > >=20 > > autoload smart-insert-last-word > > zle -N insert-last-word smart-insert-last-word > >=20 > > With this, you should be able to witness the problem. >=20 > Is this the correct fix? >=20 > Index: Functions/Zle/smart-insert-last-word > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/zsh/zsh/Functions/Zle/smart-insert-last-word,v > retrieving revision 1.2 > diff -u -r1.2 smart-insert-last-word > --- Functions/Zle/smart-insert-last-word 27 Jan 2003 16:41:17 -0000 1.2 > +++ Functions/Zle/smart-insert-last-word 8 Sep 2004 20:25:14 -0000 > @@ -86,5 +86,5 @@ > fi > done > fi > -LBUFFER[lcursor+1,cursor+1]=3D$lastcmd[-NUMERIC] > +LBUFFER[lcursor+1,cursor+1]=3D" $lastcmd[-NUMERIC]" > _ilw_cursor=3D$CURSOR Your patch fixes the issue with a minor other issue, which is purely cosmetic. This always insert a space, whether it's needed or not. Basically, with my original scenario: hugo@buena /tmp% touch test hugo@buena /tmp% alias myfoobarcat=3Dcat hugo@buena /tmp% cat test Then: hugo@buena /tmp% myfoob[] Tab: hugo@buena /tmp% myfoobarcat [] smart-insert-last-word: hugo@buena /tmp% myfoobarcat test[] smart-insert-last-word again: hugo@buena /tmp% myfoobarcattest myfoobarcat=3Dcat[] So the first call to smart-insert-last-word did put a space between myfoobarcat and test, but the second call added another leading space between myfoobarcattest and myfoobarcat=3Dcat. This extra space should only be added if the previous word was generated by a completion function, FWICT. Again, this is purely cosmetic IMO. Regards, Hugo --=20 Hugo Haas - http://larve.net/people/hugo/ --NtwzykIc2mflq5ck Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iQCVAwUBQT94KaN/9WeKWvkNAQEsmAP9H42LbRZXKj9eLHWFqmdSyexwFEYFb2uR 1o9dReZaoXYVEIXvlA3kIZb/EPrEQsJ0j7myEZJc+ZpFY0FBY35fOpSyeo+3ccih OgMPcIrzovbCYx/YbyymGv00ZSFw0hM1R2vchcKxDfQ8zS/nK0c5LXMi0skWkfcY N5erRBZovkc= =oPWM -----END PGP SIGNATURE----- --NtwzykIc2mflq5ck--