From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20295 invoked from network); 3 Jul 2001 07:31:17 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Jul 2001 07:31:17 -0000 Received: (qmail 7905 invoked by alias); 3 Jul 2001 07:29:45 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3990 Received: (qmail 7873 invoked from network); 3 Jul 2001 07:29:43 -0000 Message-ID: <20010703073028.44609.qmail@web10402.mail.yahoo.com> Date: Tue, 3 Jul 2001 00:30:28 -0700 (PDT) From: Felix Rosencrantz Subject: Using buffer for history-incremental-search-backward To: zsh-users MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I'm trying to figure out how to use history-incremental-search-backward. I do this. zsh -f host% echo abc > /dev/null host% echo def > /dev/null host% echo ghi > /dev/null host% bindkey -e host% sleep 5 ^Recho host% echo So why doesn't the control-R register? Regardless, there are times I would like to take the initial contents of the current BUFFER and start a h-i-s-b. So I tried to write a widget that can be dropped in the place of the builtin h-i-s-b. The problem I've been having is how to determine if this is the initial call of h-i-s-b, or if it is in the middle of a search in progress. Here's my current version: h-i-s-b () { local saveBuf saveBuf=$BUFFER BUFFER="" zle history-incremental-search-backward $saveBuf } zle -N h-i-s-b h-i-s-b bindkey "^R" h-i-s-b The problem is that it doesn't properly handle the situation of being called in the middle of the current search, like the builtin h.i.s.b. does. -FR. __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/