[Top][All Lists]

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

Re: Multiple next-error sources

From: Stefan Monnier
Subject: Re: Multiple next-error sources
Date: Fri, 07 Nov 2014 13:17:09 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> The many add-function composition modes are useful for advice, but
> counterproductive for customization points: the great variety of options
> makes it hard to reason about the effect any particular effect.  With a
> hook, you have a simple list of functions, possibly with a sentinel that
> delegates to a global value.

It's a tradeoff, indeed.  It gives you extra flexibility (instead of
the hook specifying that the functions will be composed with
"until-failure", each and every function gets to decide how it's
composed with the others), which of course means more choices to make.

As I said:

   If the :before-until is the problematic part, then I guess we should
   look for ways to improve that (e.g. a better name, or some way for
   a variable to say that :before-until is the default when adding
   functions to it?).

So maybe we should arrange that the "typical" way to compose the
functions for a particular variable be specified along with that
variable, so that you can use (for example)

   (add-function nil next-error-function #'my-function)

and add-function would know to use :before-until.

> I don't see any compelling reason to avoid conventional hooks.

The extra flexibility.

> They've worked for many years.

Obviously not completely, since there are occurrences of foo-function
variables, and for several of those, packages have had to "stash the
previous value, then install their own" on those vars, with latent bugs
when several packages do that on the same var.

> Requiring add-function for some customization and add-hook for others
> will only confuse users.

Yes, I'm not particularly happy about that part, admittedly.


reply via email to

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