GNU bug report logs -
#77609
How to add multiple functions to one hook with :hook in use-package?
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Mon, 7 Apr 2025 13:46:02 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
The manual says:
The @code{:hook} keyword allows adding functions to hooks. It takes
@c FIXME: The actual forms accepted by :hook are different, see below!
one argument of the form @var{hooks}, specifying one or more functions
to add to one or more hooks.
The FIXME suggests that the documentation may be incorrect!
I am precisely trying to add multiple functions to one hook, and I can't
work out how to do it with a single :hook clause. Is this in fact possible?
The most obvious syntax, copying the syntax for adding a function to
multiple hooks, does not work, e.g.:
(use-package foo-mode
:hook
(foo-mode . (function-a function-b)))
I tried other things, and searching online, and even looking at the source
code for use-package, but I can't work it out. Hence, maybe a good chance
to fix this FIXME in the docs, and explain to users how this is done, or
state that it cannot be done, and you have to use another method to add
multiple functions to a hook.
I have to say, use-package (which I have only now looked at) is a
revelation!
--
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]
This bug report was last modified 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.