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

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

Re: An idea: controlling the order of execution of elisp hook functions


From: Peter S Galbraith
Subject: Re: An idea: controlling the order of execution of elisp hook functions
Date: Fri, 07 Dec 2001 10:07:47 -0500

> Sometimes it is desirable to be able to control the order of execution of
> elisp hook functions.
> 
> A way to do this would be to give each hook function an optional property
> called, say, "priority", with expected values 'first 'normal and 'last.

As David pointed out, this level of control already exists.

I could see a use for finer-grained control that would depend less on
the order in which the 'add-hook' calls were made.  An optional priority
could be an integer between 1 and 100 (or whatever) defaulting to 50.
So if you used a priority of 60 to add a hook in which all prior
additions were done with no priority (using 'append or not), it would go
to the end.  But a subsequent call using a priority of 55 would not go
to the end, but would be place before the priority=60 hook.

So you could use 90 or something to fontify the buffer.

Peter



reply via email to

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