emacs-devel
[Top][All Lists]
Advanced

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

Re: master 9291e73 02/12: Add new 'declare' forms for command completion


From: Basil L. Contovounesios
Subject: Re: master 9291e73 02/12: Add new 'declare' forms for command completion predicates
Date: Sat, 20 Feb 2021 19:30:28 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

larsi@gnus.org (Lars Ingebrigtsen) writes:

> branch: master
> commit 9291e7316f98ab0858b323f72047ffd5a23d9ac9
> Author: Lars Ingebrigtsen <larsi@gnus.org>
> Commit: Lars Ingebrigtsen <larsi@gnus.org>
>
>     Add new 'declare' forms for command completion predicates

[...]

> +(defalias 'byte-run--set-completion
> +  #'(lambda (f _args val)
> +      (list 'function-put (list 'quote f)
> +            ''completion-predicate val)))

This is the only declare form property that doesn't quote its value,
resulting in forms like (declare (completion 'foo)) rather than the more
conventional (declare (completion foo)).  How's the following fix?

>From 3a93eb1c161c4a50b942aaabff450422b8a63679 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Sat, 20 Feb 2021 18:55:12 +0000
Subject: [PATCH] Function-quote completion property of declare form

* 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/byte-run.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index afe94bb035..6451d7fb62 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -149,7 +149,7 @@ 'byte-run--set-indent
 (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)
-- 
2.30.0

Thanks,

-- 
Basil

reply via email to

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