From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id SAA20794 for ; Thu, 30 May 1996 18:45:14 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id EAA19039; Thu, 30 May 1996 04:35:57 -0400 (EDT) Resent-Date: Thu, 30 May 1996 04:35:57 -0400 (EDT) Message-Id: <199605300833.KAA12028@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: History !# substitutions In-reply-to: "schaefer@candle.brasslantern.com"'s message of "Wed, 29 May 1996 21:40:53 MET." <960529214056.ZM28475@candle.brasslantern.com> Date: Thu, 30 May 1996 10:33:42 +0200 From: Peter Stephenson Resent-Message-ID: <"eIh7n2.0.Mf4.itLhn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1222 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu schaefer@candle.brasslantern.com wrote: > zigzag% echo foo bar !#:1 ba > [BEEP][cursor doesn't move] > > Much better, but still not perfect. I realize it probably can't expand > to the correct word, but could it at least ignore the history error and > continue completing stuff on the rest of the line? I think a judicious `stophist = 1' in get_comp_string() should fix this. At this point, any valid history expansion has been done, and the lexrestore() will fix up the real history, so this should be pretty harmless otherwise. I changed the code, then found there was a bug in menu completion: hitting tab repeatedly added an extra space each time. Then I tried it with the old version and discovered it was there anyway. Has this been reported and fixed while I was asleep? % setopt menucomplete % print zle produces % print zle_misc.c _ ^ cursor here. This is something to do with the code in do_single() around line 3343 of zle_tricky.c where something called singlec is used to determine whether a space or slash should be added. I don't know enough about what this does to fix it. Here's the (probably correct, as far as patches to zle_tricky.c go :-/) patch for ignoring previous history entries when completing. *** Src/zle_tricky.c.hstop Thu May 30 10:18:25 1996 --- Src/zle_tricky.c Thu May 30 10:19:43 1996 *************** *** 936,941 **** --- 936,942 ---- lexsave(); inpush(dupstrspace((char *) linptr), 0); strinbeg(); + stophist = 1; pushheap(); heapalloc(); i = tt0 = cp = rd = 0; -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.