mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for
malformed bindings form. Fixes: debbugs:15814
This commit is contained in:
parent
099f5cd098
commit
e6e4db3cac
2 changed files with 20 additions and 8 deletions
|
|
@ -1992,11 +1992,19 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
|
|||
(unwind-protect
|
||||
(progn
|
||||
(fset 'macroexpand #'cl--sm-macroexpand)
|
||||
;; FIXME: For N bindings, this will traverse `body' N times!
|
||||
(macroexpand-all (cons 'progn body)
|
||||
(cons (list (symbol-name (caar bindings))
|
||||
(cl-cadar bindings))
|
||||
macroexpand-all-environment)))
|
||||
(let ((expansion
|
||||
;; FIXME: For N bindings, this will traverse `body'
|
||||
;; N times!
|
||||
(macroexpand-all (cons 'progn body)
|
||||
(cons (list (symbol-name (caar bindings))
|
||||
(cl-cadar bindings))
|
||||
macroexpand-all-environment))))
|
||||
(if (or (null (cdar bindings)) (cl-cddar bindings))
|
||||
(macroexp--warn-and-return
|
||||
(format "Malformed `cl-symbol-macrolet' binding: %S"
|
||||
(car bindings))
|
||||
expansion)
|
||||
expansion)))
|
||||
(fset 'macroexpand previous-macroexpand))))))
|
||||
|
||||
;;; Multiple values.
|
||||
|
|
@ -2726,7 +2734,7 @@ macro that returns its `&whole' argument."
|
|||
(let* ((cl-entry (cons (nth 1 (nth 1 cl-form)) nil))
|
||||
(cl--active-block-names (cons cl-entry cl--active-block-names))
|
||||
(cl-body (macroexpand-all ;Performs compiler-macro expansions.
|
||||
(cons 'progn (cddr cl-form))
|
||||
(macroexp-progn (cddr cl-form))
|
||||
macroexpand-all-environment)))
|
||||
;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able
|
||||
;; to indicate that this return value is already fully expanded.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue