Implementing incremental search in emacs -


i improve emacs-eclim , add incremental search through java types in edited project (shift-ctrl-h in eclipse).

i can call eclim-java-find variants results in *eclim: find buffer.

but here comes question:

how 1 implement behaviour lets user type minibuffer (with prompt) , calls other function on each minibuffer change (new/deleted character) current minibuffer content argument or other way of accessing current search string.

you can add function post-command-hook, example. called after every command (typing character command: self-insert-command). function can check minibuffer contents function minibuffer-contents.

just don't forget remove function post-command-hook when search command finished. can use minibuffer-setup-hook , minibuffer-exit-hook control attaching function.

just don't forget remove attaching function minibuffer-setup-hook/minibuffer-exit-hook either when search command finished. :)


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -