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

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

Re: hooks, again


From: Emanuel Berg
Subject: Re: hooks, again
Date: Wed, 06 May 2015 05:25:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Nothing says just because you set the hook that way
>> you cannot before you do that examine what is in
>> the hook and function by function find out what
>> they are and if you like them to be there.
>>
>> Usually there isn't much so it isn't a lot work
>> either, and besides it is a limited but nonetheless
>> good way to examine the system.
>
> And what is it again that you gained from using
> (setq foo '(bla)) over (add-hook 'foo 'bla)?

With

    (setq foo-hook '(grok greed gold))

I can by inspection learn what the hook is. I don't
need the help or evaluation of the variable name or
anything. I need just bring up the definition itself
and read.

With

    (add-hook 'foo 'grok)
    (add-hook 'foo 'greed)
    (add-hook 'foo 'gold)

I see only what functions are at that point added -
not them already there, or if any. It is also
more bulky.

With `setq' I can add and remove functions by editing
the one form (and evaluating it), without using
`add-hook' or `remove-hook' or anything at all.

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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