]> git.eshelyaron.com Git - emacs.git/commitdiff
(macroexp-quote): Add optional argument Q.
authorEshel Yaron <me@eshelyaron.com>
Sat, 29 Mar 2025 20:44:38 +0000 (21:44 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 29 Mar 2025 20:44:38 +0000 (21:44 +0100)
lisp/emacs-lisp/macroexp.el
lisp/transient.el

index bd4c55dae6c339b1ae374ea8deb389cd72cefa86..acd2b6f0b0500be1e32bd21b16dff4bcc9297b53 100644 (file)
@@ -710,17 +710,17 @@ symbol itself."
   "Return non-nil if EXP can be copied without extra cost."
   (or (symbolp exp) (macroexp-const-p exp)))
 
-(defun macroexp-quote (v)
+(defun macroexp-quote (v &optional q)
   "Return an expression E such that `(eval E)' is V.
 
-E is either V or (quote V) depending on whether V evaluates to
+E is either V or (Q V) depending on whether V evaluates to
 itself or not."
   (if (and (not (consp v))
           (or (keywordp v)
               (not (symbolp v))
               (memq v '(nil t))))
       v
-    (list 'quote v)))
+    (list (or q 'quote) v)))
 
 (defun macroexp--fgrep (bindings sexp)
   "Return those of the BINDINGS which might be used in SEXP.
index 0d9d4d84f62e27656709caead8efe75760d7c546..1c4a3793ed25e01d4032359f5eccbe3b264567ae 100644 (file)
@@ -1278,7 +1278,7 @@ commands are aliases for."
         ((and (cl-type keyword) invalid)
          (error "Need command, argument, `:info' or `:info*'; got `%s'" invalid))
         ((cl-type symbol)
-         (use :command (macroexp-quote (pop spec))))
+         (use :command (macroexp-quote (pop spec) 'function)))
         ;; During macro-expansion this is expected to be a `lambda'
         ;; expression (i.e., source code).  When this is called from a
         ;; `:setup-children' function, it may also be a function object