[Top][All Lists]

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

Re: does customizing a hook "add-to" the hook?

From: Michael Heerdegen
Subject: Re: does customizing a hook "add-to" the hook?
Date: Mon, 15 Jul 2013 02:33:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) writes:

> If I use `customize-option' to customize a (normal) hook,
> do the functions I add via pushing the `ins' button get added to
> the default value for the hook or do they replace the default?
> I wish to achieve the former (add-to) effect and realize that `add-hook'
> does this, but would prefer to use customize if possible.

Customizing a hook and restoring the saved value later (maybe in a
different session!) happen at different moments of time, so your question
is somewhat vague.

Here is what I think happens:

- When you customize the hook, you see all elements of the hook at that
  moment.  You can delete entries or leave them, or add others.

- If you have saved it, this is the value that will be restored later
  (whereby the current value of the hook at that moment is just
  discarded, I think) when loading `custom-file'.

- But of course, after that, lisp code can still modify that value and
  add stuff to the hook.  This doesn't change the value saved by

All relevant hooks I know are empty when declared in the sources.  So if
you load your `custom-file' early enough when starting up Emacs (i.e.,
before modifying hooks or loading packages), you don't need to worry
about your or third party code adding stuff to the hook, that works

Is that what you meant?



reply via email to

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