unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Hook problem
       [not found] <E1A2nrV-00018f-H0@monty-python.gnu.org>
@ 2003-09-27 16:21 ` Faredoon Irani
  0 siblings, 0 replies; 2+ messages in thread
From: Faredoon Irani @ 2003-09-27 16:21 UTC (permalink / raw)


Hi,

	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.

Faredoon Irani

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hook problem
       [not found] <mailman.805.1064679434.21628.help-gnu-emacs@gnu.org>
@ 2003-09-27 17:11 ` David Kastrup
  0 siblings, 0 replies; 2+ messages in thread
From: David Kastrup @ 2003-09-27 17:11 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-27 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.805.1064679434.21628.help-gnu-emacs@gnu.org>
2003-09-27 17:11 ` Hook problem David Kastrup
     [not found] <E1A2nrV-00018f-H0@monty-python.gnu.org>
2003-09-27 16:21 ` Faredoon Irani

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 read-only IMAP folder(s) and NNTP newsgroup(s).