[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: updating buffer window while accepting minibuffer input
From: |
Drew Adams |
Subject: |
RE: updating buffer window while accepting minibuffer input |
Date: |
Wed, 16 Jul 2014 14:50:18 -0700 (PDT) |
> I'm wanting to traverse a list of
> buffer positions according to minibuffer keystrokes and have the
> referenced buffer position update (and eventually highlight) much like
> isearch-*. I'm stuck on the buffer position not actually updating
> whilest I am in the midst of (read-minibuffer-input). I have spent about
> two hours delving into how isearch works and came out without a clue as
> to how it actually gets minibuffer reading activated.
The Isearch code is a bit complicated. If you follow its model then you
will likely need to do many of the state-maintenance etc. things it does,
which are not necessarily directly related to searching.
Of particular note: Isearch does not really use the minibuffer (except
for odd jobs like when you use `M-e' to edit the search string).
Instead, it handles events in the usual way that Emacs does. (In Emacs,
every key you hit corresponds to a command, which is then invoked.)
In Isearch, certain input events correspond to keys that are bound to
particular Isearch actions. Other keys, such as `a', `B', `9', and `$'
have, as their corresponding action, to add the corresponding printable
character (`a', `B', `9', `$' etc.) to the search string. Search then
begins again automatically (resumes), using the newly updated search string.
See `isearch-printing-char' for the treatment of printable chars.
In sum, the minibuffer is not involved at all, for reading your input.
In particular, you do *not* want to use `read-input-from-minibuffer',
if you want Isearch-like behavior.
(FWIW, I'm no expert on Isearch. HTH. Juri Linkov is one of the best
placed to answer questions about its code.)