emacs-diffs
[Top][All Lists]
Advanced

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

master 7522788: Function-quote completion property of declare form


From: Basil L. Contovounesios
Subject: master 7522788: Function-quote completion property of declare form
Date: Fri, 26 Feb 2021 06:33:02 -0500 (EST)

branch: master
commit 752278834b3d317a65135cdaa392b0468ce7372c
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Function-quote completion property of declare form
    
    For discussion, see the following thread:
    https://lists.gnu.org/r/emacs-devel/2021-02/msg01666.html
    
    * lisp/emacs-lisp/byte-run.el (byte-run--set-completion): Quote with
    'function' for syntactical consistency with other declare form
    properties.  This allows writing (declare (completion foo)) instead
    of (declare (completion 'foo)).
    * lisp/emacs-lisp/easymenu.el (easy-menu-do-define):
    * lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Prefer
    function-put over put for function symbols.
    * lisp/subr.el (ignore, undefined): Remove #'-quoting from declare
    form; it is no longer needed.
---
 lisp/emacs-lisp/byte-run.el | 2 +-
 lisp/emacs-lisp/easymenu.el | 4 ++--
 lisp/gnus/gnus-sum.el       | 2 +-
 lisp/subr.el                | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index afe94bb..6451d7f 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -149,7 +149,7 @@ The return value of this function is not used."
 (defalias 'byte-run--set-completion
   #'(lambda (f _args val)
       (list 'function-put (list 'quote f)
-            ''completion-predicate val)))
+            ''completion-predicate (list 'function val))))
 
 (defalias 'byte-run--set-modes
   #'(lambda (f _args &rest val)
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index bcd5cfd..b49d886 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -184,12 +184,12 @@ This is expected to be bound to a mouse event."
                                  (funcall
                                   (or (plist-get (get symbol 'menu-prop)
                                                  :filter)
-                                      'identity)
+                                       #'identity)
                                   (symbol-function symbol)))
                             symbol))))
       ;; These symbols are commands, but not interesting for users
       ;; to `M-x TAB'.
-      (put symbol 'completion-predicate 'ignore))
+      (function-put symbol 'completion-predicate #'ignore))
     (dolist (map (if (keymapp maps) (list maps) maps))
       (define-key map
         (vector 'menu-bar (easy-menu-intern (car menu)))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4065cf0..ee74f01 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -2517,7 +2517,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
                               (let ((gnus-summary-show-article-charset-alist
                                      `((1 . ,cs))))
                                 (gnus-summary-show-article 1))))
-                      (put command 'completion-predicate 'ignore)
+                       (function-put command 'completion-predicate #'ignore)
                       `[,(symbol-name cs) ,command t]))
                   (sort (coding-system-list) #'string<)))))
             ("Washing"
diff --git a/lisp/subr.el b/lisp/subr.el
index cc8b85b..2323e5d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -375,7 +375,7 @@ PREFIX is a string, and defaults to \"g\"."
   "Do nothing and return nil.
 This function accepts any number of ARGUMENTS, but ignores them.
 Also see `always'."
-  (declare (completion #'ignore))
+  (declare (completion ignore))
   (interactive)
   nil)
 
@@ -923,7 +923,7 @@ For an approximate inverse of this, see `key-description'."
 
 (defun undefined ()
   "Beep to tell the user this binding is undefined."
-  (declare (completion #'ignore))
+  (declare (completion ignore))
   (interactive)
   (ding)
   (if defining-kbd-macro



reply via email to

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