use-package icon indicating copy to clipboard operation
use-package copied to clipboard

Clarify use of :hook with only the name of a hook provided

Open hugonobrega opened this issue 4 years ago • 0 comments

In the readme, one of the examples for adding a hook for loading a package is

(use-package ace-jump-mode
  :hook prog-mode)

As I understand it, this use of :hook with just the name of the hook to add to (well, minus the -hook) will only work under certain conditions, for example when the package name coincides with a function defined by the package (as in the case of ace-jump-mode and its own minor mode). It is that function that is added to the specified hook.

I suggest adding a sentence clarifying this to the readme. Since I don't know the exact set of conditions for this to work, I thought it would be better to create this issue rather than a PR as that would be likely to be incomplete.

hugonobrega avatar Mar 19 '21 19:03 hugonobrega