Subject: Re: bug#79106: [PATCH] Add new optional keywords to use-package

From: Elijah Gabe Pérez <[email-masked]>
Date: Thu, 28 Aug 2025 17:08:08 -0600

John Wiegley <[email-masked]> writes:

[...]

>> John, would you please chime in and tel what you think about this?
>
> Personally, I think that “extra” features shouldn’t be in Core, but rather in
> ELPA. What’s in core should either be what is vital, or what is likely to be
> used by the majority of users. Many of the keywords in this submission do not
> satisfy either criteria.

I agree.

Then I think it would be better to move use-package-x to ELPA.

> The desire to specify hook depth is a motivating reason to extend the behavior
> of `:hook`. I’m not sure we should add a new keyword, `:hook+`. I think we
> should extend the parsing of `:hook` so that the following are supported:
>
>   (SYM)
>   (SYM . FUNC)
>   (SYMS . FUNC)
>   (SYMS FUNC KEYS)
>
> Where KEYS would initially include `:depth N`, and leaves the door open to
> further keywords if necessary.
>
> Note that another feature requested in the past is the ability to specify
> FUNCS as a list instead of just FUNC, but that would become impossible if we
> went with the above scheme.

I think the FUNCS logic can be only added to plain lists instead
cons-cells.

The cons-cell form seems to be designed only for single functions

   (SYM . FUNC)
   (SYMS . FUNC)

On the other hand, with a list this could be easily implemented:

   (SYM FUNCS)
   (SYMS FUNCS)

I honestly don't think I have the time (and energy) to add these
features to :hook (the changes may be buggy).

At the moment I think that having them in my package is a better way to
avoid breaking use-package.

> I’m not sure how much I like the MANY<->MANY possibility of both SYMS and FUNCS anyway.

Honestly, the FUNCS feature may not be necessary.

There have been other alternatives, such as using a function or a lambda
to group the functions:

  :preface (defun my/functions () (f1) (f2) (f3))
  :hook (my-hook . my/functions)

However, in my personal opinion, this is not usually convenient because
if someone wants to remove one of the functions from that hook, they
would have to remove the defun or lambda which includes the others
functions.

-- 
- E.G via Gnus and Org.