[Top][All Lists]

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

Re: Multiple next-error sources

From: Jorgen Schaefer
Subject: Re: Multiple next-error sources
Date: Fri, 7 Nov 2014 16:41:36 +0100

On Fri, 07 Nov 2014 09:59:12 -0500
Stefan Monnier <address@hidden> wrote:

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

Thanks for the clarification.

If this is the intended default for Emacs in the future, I would like
to use this in my packages, too. Therefore, I have a few questions.

First, how can I see the sequence of functions being run after
add-function? In the example for next-error, what I was looking at
would have been a list with a few functions from different packages,
such as:

- next-error-if-compile-buffer-is-visible
- next-error-from-flymake
- next-error-from-other-source
- next-error-if-compile-buffer-is-not-visible

With a hook variable, I can C-h v the variable and clearly see what is
happening in which order. I can also easily use setq or delq to change
the order if I find it problematic. Is there a way to see and change the
order of application when using add-function?

Second, also from this example, there would be two functions there by

- next-error-if-compile-buffer-is-visible
- next-error-if-compile-buffer-is-not-visible

New functions likely want to be added in the middle, so visible
compilation buffers take precedence, but non-visible ones are chosen
last. Is there a way using add-function to add a new function in
between two existing functions?

Finally, hook variables can be added to customize to make them more
easily accessible to users. Is there some sort of customize support for
add-function, like there is for hooks/lists of functions?


reply via email to

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