From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1762 invoked from network); 29 Sep 2001 14:51:28 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Sep 2001 14:51:28 -0000 Received: (qmail 6262 invoked by alias); 29 Sep 2001 14:51:08 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4291 Received: (qmail 6251 invoked from network); 29 Sep 2001 14:51:08 -0000 To: zsh-users@sunsite.dk Subject: Re: history-incremental-search-backward with a twist References: <87pu8b3tjx.fsf@lynx.ionific.com> <1010929014105.ZM18918@candle.brasslantern.com> <1010929024149.ZM19026@candle.brasslantern.com> Mail-copies-to: nobody From: Hannu Koivisto Date: 29 Sep 2001 17:51:04 +0300 In-Reply-To: <1010929024149.ZM19026@candle.brasslantern.com> (Bart Schaefer's message of "Sat, 29 Sep 2001 02:41:48 +0000") Message-ID: <87g0963vaf.fsf@lynx.ionific.com> User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto Bart Schaefer writes: | On Sep 29, 1:41am, Bart Schaefer wrote: | } | } Presuming you have 4.0.x, this is ridiculously easy ... I have 4.0.2, running on Debian GNU/Linux unstable x86; sorry I forgot to mention this. | function beginning-incremental-search { | if [[ $LASTWIDGET == $WIDGET ]] | then zle .$WIDGET | else zle .$WIDGET $LBUFFER | fi | } | | zle -N history-incremental-search-backward beginning-incremental-search | zle -N history-incremental-search-forward beginning-incremental-search This doesn't seem to do what I want. Let's try again. If, after evaluating that, I say: dir bar foo echo foo dir^Rfoo I see: [my-prompt] dir failing bck-i-search: dirfoo_ whereas I expected it to find "dir bar foo" history entry. That is, your change seems to insert to the bck-i-search: -prompt, as if I had written it, what I have on the command line at the moment I invoke the search. In order to do what I want, such insertion would work only if a) the search would be regexp search and b) it inserted "^.*" instead of just "". | Which means you can't use the old history-incremental-search-* any more if | you want this variant to work. This is not a problem; I don't think I have any use for normal history-incremental-search-* behaviour. -- Hannu Please don't send copies of list mail