From: F. Jason Park Date: Sat, 25 Mar 2023 16:13:40 +0000 (-0700) Subject: Add subcommand dispatch facility to erc-cmd-HELP X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b1007516cdf7a21b44340838d9d9509a81577436;p=emacs.git 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.) --- 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))