[Top][All Lists]

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

Re: delayed-warnings-hook versus deferred-action-function

From: Juanma Barranquero
Subject: Re: delayed-warnings-hook versus deferred-action-function
Date: Sun, 5 Feb 2012 01:29:36 +0100

On Sun, Feb 5, 2012 at 01:06, Glenn Morris <address@hidden> wrote:

> In 24.1, deferred-action-function has been deprecated in favour of just
> using post-command-hook. Fair enough, the former was never really used
> for anything.

deferred-function-action was deprecated for the two reasons you
mention: it was never used (I think googling it gave just one use, and
it was used just like post-command-hook), and it was poorly
documented. There was not way to resolve conflicts between two
applications wanting to use it for different purposes.

> However, delayed-warnings-hook has been added, and, although it has a
> more clearly documented purpose, seems to be functionally equivalent to
> the deprecated interface.

It is functionally equivalent, but the documented API of
deferred-function-(action|list) was so vague that using it for delayed
warnings made impossible to guarantee that someone else would not
trample over the warnings. So deprecating one and adding the other is
a way of documenting the delayed warnings use. For non-warnings,
post-command-hook is enough.

> Why couldn't an element just be
> added to post-command-hook to process delayed-warnings?

The idea is, some day, to add a defcustom interface to allow the user
adding other warnings-processing functions. In my .emacs I have one to
filter out specific warnings, for example. That could be done from
post-command-hook, but it would be messier.


reply via email to

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