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: John Wiegley <johnw <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77609 <at> debbugs.gnu.org, Reuben Thomas <rrt <at> sc3d.org>
Subject: bug#77609: How to add multiple functions to one hook with :hook in use-package?
Date: Thu, 24 Apr 2025 18:10:32 -0700
>>>>> Eli Zaretskii <eliz <at> gnu.org> writes:

>> 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?

I mean, there’s no reason it could be extended to support a list, like:

  (foo-mode . (function-a function b))

So do we want to document the restriction, or relax it?

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




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.