[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25581: 25.1; Incorrect statement in (elisp) `Hooks'
From: |
Drew Adams |
Subject: |
bug#25581: 25.1; Incorrect statement in (elisp) `Hooks' |
Date: |
Mon, 24 Aug 2020 09:18:27 -0700 (PDT) |
> I think the confusing thing here is that there are two ways to modify
> these single function hooks: setq and add-function.
`setq' can always be used to change a variable's value.
But that doesn't mean it's always the best thing to use.
See earlier posts in this thread, about variables whose
value is a "single function". They can be hooks, but
need not be hooks (and this, regardless of their names).
Some vars are _intended_ to only ever have a single
function as their value. Some vars are _intended_ to
have a value that can be a single function or a list of
functions. Some of the latter kind of variables are
hooks. (Maybe _all_ of the latter can be treated as
hooks; maybe not.)
`add-hook' is the best way to add a function to a hook.
This is so, regardless of its name. That you can use
`setq' or something else instead doesn't make that TRT.