zsh-users
 help / color / mirror / code / Atom feed
From: Felix Rosencrantz <f_rosencrantz@yahoo.com>
To: zsh-users <zsh-users@sunsite.auc.dk>
Subject: Using buffer for history-incremental-search-backward
Date: Tue, 3 Jul 2001 00:30:28 -0700 (PDT)	[thread overview]
Message-ID: <20010703073028.44609.qmail@web10402.mail.yahoo.com> (raw)

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/


             reply	other threads:[~2001-07-03  7:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-03  7:30 Felix Rosencrantz [this message]
2001-07-03  8:34 ` Bart Schaefer
2001-07-04  6:14   ` Felix Rosencrantz
2001-07-04 14:39     ` Bart Schaefer
2001-07-06  6:32 Felix Rosencrantz
2001-07-06  8:24 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010703073028.44609.qmail@web10402.mail.yahoo.com \
    --to=f_rosencrantz@yahoo.com \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).