help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Modifying a hook while it's being executed


From: David Kastrup
Subject: Re: Modifying a hook while it's being executed
Date: Mon, 08 Aug 2005 22:55:17 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

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


reply via email to

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