From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: does customizing a hook "add-to" the hook?
Date: Mon, 15 Jul 2013 02:33:46 +0200 [thread overview]
Message-ID: <871u703bmd.fsf@web.de> (raw)
In-Reply-To: 87wqou6tkw.fsf@nyu.edu
gottlieb@nyu.edu 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
customize.
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
normally.
Is that what you meant?
Regards,
Michael.
next prev parent reply other threads:[~2013-07-15 0:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-13 21:25 does customizing a hook "add-to" the hook? gottlieb
2013-07-15 0:33 ` Michael Heerdegen [this message]
2013-07-15 1:12 ` Michael Heerdegen
2013-07-15 18:50 ` gottlieb
2013-07-15 22:49 ` Michael Heerdegen
2013-07-16 14:06 ` gottlieb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871u703bmd.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).