bug#81643: 32.0.50; use-package :hook is not the same as :init add-hook

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> Date: Sun, 16 Aug 2026 23:06:56 -0400
> From: Lucas Jimenez via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email protected]>
> 
> 
> 
> Hi,
> 
> The manual says that :hook is the same as add-hook in :init
> These tests show that it isn't the case.
> 
> I don't know if the manual is wrong or if it's a bug with use-package
> 
> I would prefer to be a bug, since I like to use all the use-package
> attributes as much as possible.
> 
> All tests are done one by one with emacs -Q and restarting each time to
> test each case.  Both tests should end with the modus-vivendi loaded, but
> that isn't the case proving that :hook is not the same as add-hook in :init
> 
> Test 1:
> 
> (use-package modus-themes
>   :no-require t
>   :init
>   (require-theme 'modus-themes)
>   (defun test-hook-attr ()
>     (load-theme 'modus-vivendi))
>   :hook (modus-themes-after-load-theme . test-hook-attr)
>   :config
>   (modus-themes-load-theme 'modus-operandi))
> 
> Test 2:
> 
> 
> (use-package modus-themes
>   :no-require t
>   :init
>   (require-theme 'modus-themes)
>   (defun test-hook-attr ()
>     (load-theme 'modus-vivendi))
>   (add-hook 'modus-themes-after-load-theme-hook #'test-hook-attr)
>   :config
>   (modus-themes-load-theme 'modus-operandi))

Thanks.

John, any comments or suggestions?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.