all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Subject: Re: Modifying a hook while it's being executed
Date: Mon, 08 Aug 2005 22:55:17 +0200	[thread overview]
Message-ID: <854qa0174a.fsf@lola.goethe.zz> (raw)
In-Reply-To: mailman.3053.1123533819.20277.help-gnu-emacs@gnu.org

Henrik Enberg <henrik.enberg@telia.com> writes:

>> From: kcin@mytrashmail.com
>> Date: 8 Aug 2005 13:21:13 -0700
>> 
>> rgb wrote:
>> >
>> > This line appears in remove-hook.
>> >
>> > (setq hook-value (delete function (copy-sequence hook-value)))
>> >
>> > It makes me think that a change to the hook's value will not
>> > be visible to the present execution of the run-hooks command.
>> > So I'd say it appears to be perfectly safe.
>> 
>> Yes, it seems OK. However I wonder why it is not simply
>> 
>>   (setq hook-value (remove function hook-value))
>>  
>> remove also returns a copy. Is there a difference?
>
> `remove' is part of the cl library which isn't supposed to be used in
> core Emacs.

remove is a compiled Lisp function in `subr'.
(remove ELT SEQ)

Return a copy of SEQ with all occurrences of ELT removed.
SEQ must be a list, vector, or string.  The comparison is done with `equal'.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  parent reply	other threads:[~2005-08-08 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 15:32 Modifying a hook while it's being executed PT
2005-08-08 15:42 ` J. David Boyd
     [not found] ` <mailman.3028.1123516720.20277.help-gnu-emacs@gnu.org>
2005-08-08 18:51   ` rgb
2005-08-08 20:21     ` kcin
2005-08-08 20:34       ` Henrik Enberg
     [not found]       ` <mailman.3053.1123533819.20277.help-gnu-emacs@gnu.org>
2005-08-08 20:55         ` David Kastrup [this message]
2005-08-08 21:08           ` Henrik Enberg
     [not found]           ` <mailman.3058.1123535725.20277.help-gnu-emacs@gnu.org>
2005-08-08 21:32             ` David Kastrup

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=854qa0174a.fsf@lola.goethe.zz \
    --to=dak@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.