>From e4aa6d281e492edb1ca8a6f3c50586fdffe7867e Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sat, 25 Mar 2023 09:13:40 -0700 Subject: [PATCH 1/3] Add subcommand dispatch facility to erc-cmd-HELP * lisp/erc/erc.el (erc-cmd-HELP): Change signature by adding &rest parameter. Attempt to autoload symbol. Look for symbol property `erc--cmd-help' and, if found, assume it's a function and call it with &rest args. --- lisp/erc/erc.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 69bdb5d71b1..60aa26579c5 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3203,7 +3203,7 @@ erc-cmd-CTCP (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 @@ -3236,6 +3236,11 @@ erc-cmd-HELP nil))))) (if sym (cond + ((progn (autoloadp (symbol-function sym)) + (autoload-do-load (symbol-function sym)) + nil)) + ((get sym 'erc--cmd-help) + (apply (get sym 'erc--cmd-help) rest)) ((boundp sym) (describe-variable sym)) ((fboundp sym) (describe-function sym)) (t nil)) -- 2.39.2