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

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

Re: Letting hooks?


From: Tassilo Horn
Subject: Re: Letting hooks?
Date: Wed, 06 Jun 2012 08:36:02 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.0.97 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

Hi Eric,

> (defun my-function ()
>   (let ((grommet-created-hook
>        (push my-hook-function
>              grommet-created-hook)))
>     (create-grommet)))

I think `push' is definitively a bad idea, cause it changes
`grommet-created-hook' global value, too.  And `my-hook-function' has to
be quoted.

  (let ((grommet-created-hook
         (cons 'my-hook-function grommet-created-hook)))
    (create-grommet))

should do the trick.

Bye,
Tassilo




reply via email to

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