emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b1007516cdf 02/37: Add subcommand dispatch facility to erc-cmd-HE


From: F. Jason Park
Subject: master b1007516cdf 02/37: Add subcommand dispatch facility to erc-cmd-HELP
Date: Sat, 8 Apr 2023 17:31:26 -0400 (EDT)

branch: master
commit b1007516cdf7a21b44340838d9d9509a81577436
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>

    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.)
---
 lisp/erc/erc.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]