[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Letting hooks?
From: |
Stefan Monnier |
Subject: |
Re: Letting hooks? |
Date: |
Thu, 07 Jun 2012 20:57:08 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
> (let ((grommet-created-hook
> (cons 'my-hook-function grommet-created-hook)))
> (create-grommet))
This will often work, indeed, and is fairly elegant.
For some hooks where the buffer-localness is used/modified within
create-grommet, you may prefer:
(unwind-protect
(progn
(add-hook 'grommet-created-hook 'my-hook-function)
(create-grommet))
(remove-hook 'grommet-created-hook 'my-hook-function))
-- Stefan