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

From: Reuben Thomas <[email-masked]>
Date: Mon, 7 Apr 2025 14:46:59 +0100

On Mon, 7 Apr 2025 at 14:43, Reuben Thomas <[email-masked]> 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