GNU bug report logs - #77609
How to add multiple functions to one hook with :hook in use-package?

Previous Next

Package: emacs;

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>

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>, John Wiegley <johnw <at> gnu.org>
Cc: 77609 <at> debbugs.gnu.org
Subject: bug#77609: How to add multiple functions to one hook with :hook in use-package?
Date: Sun, 13 Apr 2025 11:49:15 +0300
> Date: Mon, 7 Apr 2025 14:46:59 +0100
> From:  Reuben Thomas via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> On Mon, 7 Apr 2025 at 14:43, Reuben Thomas <rrt <at> sc3d.org> wrote:
> 
>  I tried other things, and searching online, and even looking at the source code for use-package, but I
>  can't work it out.
> 
> I had another look at the source code, and found this:
> 
>            (concat label " a <symbol> or (<symbol or list of symbols> . <symbol or function>)"
>                    " or list of these")
> 
> It's unfortunate that this is part of an error message, as I've never seen the error, but I think this explains the
> syntax, and indeed says that you can't add multiple functions to a single hook with one :hook line; in other
> words, it would be necessary to write something like:
> 
> (use-package foo-mode
>    :hook
>    ((foo-mode . function-a)
>    (foo-mode . function-b)))

John, can you please help in understanding how the documentation could
be clarified in this regard?




This bug report was last modified 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.