emacs-diffs
[Top][All Lists]
Advanced

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

scratch/command f6f9222 1/2: Fix ;;;###autoload cookie handling


From: Lars Ingebrigtsen
Subject: scratch/command f6f9222 1/2: Fix ;;;###autoload cookie handling
Date: Fri, 12 Feb 2021 07:27:32 -0500 (EST)

branch: scratch/command
commit f6f922222986ec1b5c529dac738413dfd580990d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix ;;;###autoload cookie handling
---
 lisp/emacs-lisp/autoload.el | 9 +++++++--
 lisp/simple.el              | 4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index ec7492d..ae7e763 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -143,7 +143,11 @@ expression, in which case we want to handle forms 
differently."
            (interactive (pcase body
                           ((or `((interactive . ,_) . ,_)
                                `(,_ (interactive . ,_) . ,_))
-                           t))))
+                           t)
+                          (`((command . ,modes) . ,_)
+                           (list 'quote (car modes)))
+                          (`(,_ (command . ,modes) . ,_)
+                           (list 'quote (car modes))))))
         ;; Add the usage form at the end where describe-function-1
         ;; can recover it.
         (when (consp args) (setq doc (help-add-fundoc-usage doc args)))
@@ -207,7 +211,8 @@ expression, in which case we want to handle forms 
differently."
                                   easy-mmode-define-minor-mode
                                   define-minor-mode))
                      t)
-                (eq (car-safe (car body)) 'interactive))
+                (or (eq (car-safe (car body)) 'interactive)
+                    (eq (car-safe (car body)) 'command)))
            ,(if macrop ''macro nil))))
 
      ;; For defclass forms, use `eieio-defclass-autoload'.
diff --git a/lisp/simple.el b/lisp/simple.el
index f9d9558..4914f91 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1961,7 +1961,9 @@ to get different commands to edit and resubmit."
            (complete-with-action action obarray string pred)))
        (lambda (sym)
          (and (commandp sym)
-              (funcall read-extended-command-predicate sym buffer)))
+              (if (get sym 'completion-predicate)
+                  (funcall (get sym 'completion-predicate) sym buffer)
+                (funcall read-extended-command-predicate sym buffer))))
        t nil 'extended-command-history))))
 
 (defun completion-major-mode-p (symbol buffer)



reply via email to

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