From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6226 invoked from network); 10 Jun 1998 04:37:37 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Jun 1998 04:37:37 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id AAA28600; Wed, 10 Jun 1998 00:25:29 -0400 (EDT) Resent-Date: Wed, 10 Jun 1998 00:25:13 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980609212557.ZM8906@candle.brasslantern.com> Date: Tue, 9 Jun 1998 21:25:57 -0700 In-Reply-To: <980609132319.ZM7074@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "User-defined replacement for *-line-or-search in 3.1.4" (Jun 9, 1:23pm) References: <19980428143325.59341@gmp-fores1.uk.jpmorgan.com> <199804281408.PAA32237@taos.demon.co.uk> <19980609141304.41665@gmp-fores1.uk.jpmorgan.com> <980609082238.ZM5717@candle.brasslantern.com> <980609114223.ZM6613@candle.brasslantern.com> <980609132319.ZM7074@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@math.gatech.edu Subject: Re: User-defined replacement for *-line-or-search in 3.1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"gmRiW.0.C-6.cgWVr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1587 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jun 9, 1:23pm, I wrote: } Subject: User-defined replacement for *-line-or-search in 3.1.4 } } Shouldn't $#LBUFFER == $CURSOR == $#moveorsearchpattern on first call to this } function? If so, why is the +1 necessary? (If I leave it out, the call to } history-beginning-search-*ward uses too short a prefix.) } } --- 8< --- snip --- 8< --- } } # Why is +1 needed here, but not needed at $#BUFFER? } CURSOR=$[$#moveorsearchpattern+1] } zle history-beginning-search-backward } CURSOR=$#BUFFER I've just been fooling with this in the debugger, and I can no longer get the behavior I was seeing where adding one to the pattern length was necessary. I don't know what strangeness I had going on, though I have done a rebuild in the interim ... anyway, I recommend changing the first assignment of CURSOR to CURSOR=$#moveorsearchpattern in both of the functions I posted earlier today. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com