GNU bug report logs -
#79106
[PATCH] Add new optional keywords to use-package
Previous Next
Full log
Message #11 received at 79106 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Philip Kaludercic <philipk <at> posteo.net> writes:
> Elijah Gabe Pérez <eg642616 <at> gmail.com> writes:
>
> I guess it would be good to discuss the content of the patch now that we
> are considering to merge it.
Sure.
>> Tags: patch
>>
>> As discussed in
>> https://lists.gnu.org/archive/html/emacs-devel/2025-07/msg00354.html
>>
>> This patch add new optional keywords to use-package, most of them are
>> inspired by suggestions from use-package bug-tracker on github
>>
>> This includes following keywords:
>>
>> * :advice Add or remove function advices.
>
> I did not understand how this uses :advice to create something
> use-package specific that has an advantage over `define-advice'.
This acts more to `advice-add` than `define-advice`. It is intended to
add advices from some packages, such as consult, which has the
`consult-register-window` function, that is intended to override
`register-preview`.
This is also inspired by leaf.el which have `:advice` and `:advice-remove`.
>> * :defvar-keymap Define a new keymap or override an existent one.
>
> Why is this something that a user would be interested in when
> configuring a package?
:defvar-keymap is meant for people that wants to use their own
keybindings in a mode (such as cua-mode) instead mode keybindings.
In my case it's useful when i want to use a few keybindings from a mode,
not all.
>> * :doc Document the use-package declaration instead using comments.
>>
>> * :tag Like :doc, but for categorizing.
>> (This and :doc does nothing)
>
> Can you explain what these tags are good for?
At this moment, both :tag (and :doc) are useless, the only use I can see
for it would be as an identifier for when someone wants to export their
configuration as a web page. I decided include them because I've seen
some configurations that use them (either from leaf.el or a personal
extension).
Perhaps in the future they can be modified to give a better use, but at
this moment I can't think of any.
>> * :hook+ Like default :hook, but allows to set the hook depth and set
>> multiple functions in the hook (or for each hook).
>>
>> Although I tried to make it compatible with :hook, there may be some
>> things I missed, so I decided to put it separately instead of merging
>> it with :hook. In addition, its syntax is more complex compared to
>> :hook.
>
> I can imagine that the name is confusing to beginners, and also question
> if it might be cleaner to just advise users to use `add-hook' if they
> want to do something specific and more technical.
Yeah, but :hook+ already covers most of the basics for add-hook.
It can put the same depth for all the hooks in a region:
(:depth -10
(prog-mode . whitespace-mode) ; <- -10
(xml-mode . electric-pair-mode)) ; <- -10
>> * :setopt Like :custom, but can also bind plain variables.
>> This uses the `setopt` function for bind the variables.
>
> Would it make sense to re-use :custom but modify the behaviour with a
> user-option?
I didn't quite understand this, did you mean to modify :custom for
handle this instead? In that case, it would better to ask to John.
> Wrt. the patch, I would still merge the files into one, instead of
> having each keyword in a separate file.
This is inconvenient, since if someone wants to use only one of these
keywords, they would have to load the entire file.
Keeping them separate prevents this and is also easier to maintain and
move them to ELPA (if it is decided in the future).
Also I'm sending a fixed patch, I'm not sure if the additional keywords
should be documented in the manual.
[0001-Add-new-optional-keywords-to-use-package.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via Gnus and Org.
This bug report was last modified 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.