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

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

Re: how to temporarily remove a function from a hook?


From: Pascal J. Bourguignon
Subject: Re: how to temporarily remove a function from a hook?
Date: Thu, 09 Jul 2009 04:42:46 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

> What is the right way to temporarily remove a function from a hook?
>
>
> My best guess is:
>
> (let ((foo-hook (progn (remove-hook 'bar 'foo-hook) foo-hook)))
>   ...)


This won't work, because remove-hook actually modifies the outside
variable foo-hook.


Write simply:

(let ((foo-hook (remove 'bar foo-hook)))
   ...)


-- 
__Pascal Bourguignon__


reply via email to

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