use-package
use-package copied to clipboard
Add :commands* keyword
Add :command* keyword proposed at #851. Special thanks to @aspiers.
This :command* is similar to :command, but it generate autoload
statement as no-interactive one.
There should be a less confusing name than :command* for this. IIRC, commands in Emacs terminology are always interactive.
maybe :autoload instead?
Function: commandp object &optional for-call-interactively This function returns t if object is a command. Otherwise, it returns nil.
Commands include strings and vectors (which are treated as keyboard macros), lambda expressions that contain a top-level interactive form (see Using Interactive), byte-code function objects made from such lambda expressions, autoload objects that are declared as interactive (non-nil fourth argument to autoload), and some primitive functions. Also, a symbol is considered a command if it has a non-nil interactive-form property, or if its function definition satisfies commandp.
If for-call-interactively is non-nil, then commandp returns t only for objects that call-interactively could call—thus, not for keyboard macros.
Completely agree. I renamed :commands* to :autoload.
@conao3 commented on February 22, 2021 7:13 PM:
Completely agree. I renamed
:commands*to:autoload.
As suggested in #851 I think :functions is a better choice of symbol here. :autoload is a confusing choice to me because :commands already causes autoloads, so there is an undesirable overlap between the two if this name is used.
Thanks, @aspiers. Now I think :functions is better. How about @thomasf?
CC: @jwiegley
I don't think that is a clean orthogonal feature regardless of what we name it. :autoload is at least somewhat self explanatory even if :commands also creates autoloads (for commands). I'm not sure if I think that one argument is particularly stronger than the other here.
@thomasf commented on February 22, 2021 7:21 PM:
I don't think that is a clean orthogonal feature regardl ess of what we name it.
:autoloadis at least somewhat self explanatory even if:commandsalso creates autoloads (for commands. I'm not sure if I think that one argument is particularly stronger than the other here.
You are right, my suggestion isn't much better :laughing: Hmmm, I wonder if there is a better word ...
:functions is already use to satisfy the byte-compiler, but we could easily make that keyword do this as well.
Thank you, I think this is a good and safe addition.