[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Q on after-change-functions
From: |
Stefan Monnier |
Subject: |
Re: Q on after-change-functions |
Date: |
Thu, 23 Feb 2006 10:50:23 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> (set-buffer (window-buffer (minibuffer-window)))
> (add-hook 'after-change-functions 'foobar nil 'local)
The minibuffer's buffer is refreshed/recreated/reset every time you
enter it. Maybe it would work if you added (put 'after-change-functions
'permanent-local t), but that would be truly evil. Also it would still fail
in the case of recursive minibuffers where you may have several minibuffer
buffers active at the same time.
Instead, you want to do your `add-hook' from minibuffer-setup-hook.
See icomplete-mode for an example of a mode that does something similar
(tho it doesn't use after-change-functions but pre/post-command-hook
instead).
Stefan