help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hook problem


From: David Kastrup
Subject: Re: Hook problem
Date: 27 Sep 2003 19:11:36 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Faredoon Irani <u02114@cs.unipune.ernet.in> writes:

>       I've installed a hook function for the 'after-change-functions' 
> hook since I would like to process each and every key pressed. The problem 
> is that I do not want to process anything through the hook function if 
> the result of a key press accesses the minibuffer, for e.g. C-x C-f. 
> This results in the processing of all characters displayed in the 
> minibuffer also! I have tried to use minibuffer hooks to toggle a variable 
> value when the minibuffer is entered and exited, but the key hook is being 
> processed much earlier. Please help.

add-hook has an argument that allows you adding to a buffer-local
value of the hook.

You could also, in your buffer, say
(make-local-variable 'after-change-functions)
before adding to it, but in versions of Emacs where add-hook can
support buffer-locals, that would be the preferable option.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

[Prev in Thread] Current Thread [Next in Thread]