[Top][All Lists]

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

Re: Multiple next-error sources

From: Alan Mackenzie
Subject: Re: Multiple next-error sources
Date: Fri, 7 Nov 2014 16:55:51 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Stefan.

On Fri, Nov 07, 2014 at 09:59:12AM -0500, Stefan Monnier wrote:
> > The advantage of hooks is that it makes it easier for users to
> > customize the behavior by adding and removing various entries.

> While it's true that

>     (add-hook 'next-error-functions #'my-function)

> is shorter than

>     (add-function :before-until next-error-function #'my-function)

> I don't think it warrants the addition of a next-error-functions.

Why not?

> 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?).

> > Is add-function intended to replace hooks like this in general?

> Somewhat, yes.  I have no intention to go around and replace existing
> hooks in the forseeable future (except for those rare hooks that used
> with-wrapper-hook), but I'll favor new foo-function over new
> foo-functions.

Why?  I'm adding my voice to the clamour of dissent.

It would seem that the use of single functions, with `add-function' is
inferior to the conventional hook mechanism in every way.  What am I
missing?  In addition to the things cited by Daniel, there's:

(i) the danger (near certainty) that somebody is going to use `setq'
rather than `add-function' to configure it;

(ii) the additional incompatibility with other Emacsen;

(iii) the difficulty (or perhaps clumsiness) in looking at the contents
of an advised function.  There would seem to be nothing equivalent to
M-: after-change-functions.

So why are you changing from the conventional hook mechanism, which works
so well?  What is the advantage of the new scheme.

Incidentally, I had a look at the documentation for add-advice, and
there's a problem with it.  "Advice" in English has no plural - there's
no such word as "advices".  If it's necessary to emphasize the plurality,
then "pieces of advice" can be used.  There's no such thing as "an
advice", rather you'd say "some advice".  It's a bit like you wouldn't
refer to a lake as "a big water"; you'd say it contains "a lot of water".
I think there's a term in linguistics for such a word, but I don't know
it off hand.

Incidentally 2, the verb corresponding to the noun "advice" is "to

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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