Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:hook forms not equivalent #1074

Open
just-walk opened this issue Feb 29, 2024 · 0 comments
Open

:hook forms not equivalent #1074

just-walk opened this issue Feb 29, 2024 · 0 comments

Comments

@just-walk
Copy link

When adding julia-snail-mode to the julia-mode hook, different forms of the use-package syntax that should have "equivalent" behavior are in fact different. (https://www.gnu.org/software/emacs/manual/html_mono/use-package.html#Hooks)

This first form does what I would expect it to do.

(use-package julia-snail
  :ensure t
  :custom
  (julia-snail-terminal-type :eat)
  :hook (julia-mode . julia-snail-mode)
)

The variable julia-mode-hook then evaluates to (julia-snail-mode).

This second form shortens the hook declaration. By the documentation, this should append -mode to the package name and add it to the hook specified. In this case julia-snail-mode should be appended to julia-mode-hook.

(use-package julia-snail
  :ensure t
  :custom
  (julia-snail-terminal-type :eat)
  :hook julia-mode
)

Instead, variable julia-mode-hook evaluates to (julia-snail).

What's going on? Is this a bug in use-package, or am I misunderstanding the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant