Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

feature request: support local and depth arguments for :hook #965

@Hugo-Heagren

Description

@Hugo-Heagren

I'm trying to port some of my old config into neater use-package declarations and I have a few add-hooks which use the optional DEPTH and LOCAL args of that function. These aren't currently supported by use-package, but it would be nice if they were. Perhaps something like one of these?

More consistent with use-package's use of keys:

(use-package foo
  :hook
  (bar-mode . foo-mode-hook :depth 80 :local t))

And more consistent with add-hook (though with the disadvantage that comes with all optional positional arguments -- specifying only the last one requires specifying the others as nil, which is kinda cluttered):

(use-package foo
  :hook
  (bar-mode . foo-mode-hook 80 t))

Personally I prefer the first, but either would be good. I would be happy to try implementing this and submit a PR..

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions