all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: gottlieb@nyu.edu
To: help-gnu-emacs@gnu.org
Subject: Re: does customizing a hook "add-to" the hook?
Date: Tue, 16 Jul 2013 10:06:29 -0400	[thread overview]
Message-ID: <87txjusioq.fsf@nyu.edu> (raw)
In-Reply-To: <87mwpn4exf.fsf@web.de> (Michael Heerdegen's message of "Tue, 16 Jul 2013 00:49:16 +0200")

On Mon, Jul 15 2013, Michael Heerdegen wrote:

> gottlieb@nyu.edu writes:
>
>> Is it guaranteed or suggested that hook are by default empty?
>
> No, it's not a convention AFAICT.  And there are examples in the sources
> where this is not the case, although they are a minority.
>
> There are probably also cases where a user indeed wants to replace an
> element of a hook variable with another one or "delete" elements, so it
> makes some sense that hooks are not always declared empty.
>
> You have to be a bit careful.  There is no absolute guarantee
> that your customization will work in future Emacsen.  If you want a more
> finegrained control, use Lisp.  But also what you do in Lisp can be
> wrong in future Emacsen.
>
> I agree that there is a bit a disparity between the manual
> ((emacs) Hooks):
>
> |    You can set a hook variable with ‘setq’ like any other Lisp
> | variable, but the recommended way to add a function to a hook (either
> | normal or abnormal) is to use ‘add-hook’, as shown by the following
> | examples.  *Note (elisp)Hooks::, for details.
>
> and how Customize works (setting the hook variable instead of adding).

Indeed.  That disparity is exactly what triggered my question.
Thank you for clarifying.

allan



      reply	other threads:[~2013-07-16 14:06 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
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 [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txjusioq.fsf@nyu.edu \
    --to=gottlieb@nyu.edu \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.