"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.
((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