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: Reuben Thomas <rrt <at> sc3d.org>
To: 77609 <at> debbugs.gnu.org
Subject: bug#77609: How to add multiple functions to one hook with :hook in use-package?
Date: Mon, 7 Apr 2025 14:46:59 +0100
[Message part 1 (text/plain, inline)]
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)))

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

This bug report was last modified 22 days ago.

Previous Next


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