summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2023-03-25 09:13:40 -0700
committerF. Jason Park <jp@neverwas.me>2023-04-08 14:23:50 -0700
commitb1007516cdf7a21b44340838d9d9509a81577436 (patch)
treed7171e29b6d38519d17458a8e609b2c3ff16ef89
parentdfaeeba97cc45015db5a785aa8f94089f960029d (diff)
downloademacs-b1007516cdf7a21b44340838d9d9509a81577436.tar.gz
Add subcommand dispatch facility to erc-cmd-HELP
* lisp/erc/erc.el (erc-cmd-HELP): Change signature by adding &rest parameter. Look for symbol property `erc--cmd-help' and, if found, assume it's a function and call it with &rest args after attempting to autoload the primary command symbol. (Bug#62444.)
-rw-r--r--lisp/erc/erc.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index f0ea7510c65..f76c770f585 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -3204,7 +3204,7 @@ VERSION and so on. It is called with ARGS."
(erc-send-ctcp-message nick str)
t))
-(defun erc-cmd-HELP (&optional func)
+(defun erc-cmd-HELP (&optional func &rest rest)
"Popup help information.
If FUNC contains a valid function or variable, help about that
@@ -3237,6 +3237,10 @@ For a list of user commands (/join /part, ...):
nil)))))
(if sym
(cond
+ ((get sym 'erc--cmd-help)
+ (when (autoloadp (symbol-function sym))
+ (autoload-do-load (symbol-function sym)))
+ (apply (get sym 'erc--cmd-help) rest))
((boundp sym) (describe-variable sym))
((fboundp sym) (describe-function sym))
(t nil))