[Top][All Lists]

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

Re: elisp macros problem

From: Kalle Olavi Niemitalo
Subject: Re: elisp macros problem
Date: Sun, 25 Jul 2004 13:59:31 +0300
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Lowell Kirsh <address@hidden> writes:

> the reason that i didn't realize it was working was that i
> thought you could (add-hook 'some-mode ...) more than once, but
> really, this will just overwrite the previously added hook.

No, it won't.

(setq sample-hook '())
(add-hook 'sample-hook 'sample-1)
(add-hook 'sample-hook 'sample-2)
(add-hook 'sample-hook 'sample-2)

After these forms, the value of sample-hook is (sample-2 sample-1).
The second add-hook did not overwrite the first one.
However, the third one had no effect, because sample-2 was
already in the hook.

reply via email to

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