aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Trapuzzano2013-11-06 23:38:00 -0500
committerStefan Monnier2013-11-06 23:38:00 -0500
commite6e4db3cac4630fc83e4bc520f99823572c3e592 (patch)
tree74767941ffad750434f2906d111ddd09a32ecee5
parent099f5cd098de76422968c2755b4c37594e8fca2e (diff)
downloademacs-e6e4db3cac4630fc83e4bc520f99823572c3e592.tar.gz
emacs-e6e4db3cac4630fc83e4bc520f99823572c3e592.zip
* lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for
malformed bindings form. Fixes: debbugs:15814
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/emacs-lisp/cl-macs.el20
2 files changed, 20 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index edb37fa3d39..d80d0389676 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,14 @@
12013-11-05 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change)
2
3 * emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for
4 malformed bindings form (bug#15814).
5
12013-11-07 Dmitry Gutov <dgutov@yandex.ru> 62013-11-07 Dmitry Gutov <dgutov@yandex.ru>
2 7
3 * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of 8 * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of
4 "." compared to " @ ". This incidentally fixes some indentation 9 "." compared to " @ ". This incidentally fixes some indentation
5 examples with "do". 10 examples with "do".
6 (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or 11 (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or "or".
7 "or".
8 (ruby-smie-grammar): New tokens: "and" and "or". 12 (ruby-smie-grammar): New tokens: "and" and "or".
9 (ruby-smie--args-separator-p): Fix the check for tokens at POS. 13 (ruby-smie--args-separator-p): Fix the check for tokens at POS.
10 Exclude "and" and "or". Remove "do" in order to work around token 14 Exclude "and" and "or". Remove "do" in order to work around token
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 60fdc09c053..bd97bcb585c 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1992,11 +1992,19 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
1992 (unwind-protect 1992 (unwind-protect
1993 (progn 1993 (progn
1994 (fset 'macroexpand #'cl--sm-macroexpand) 1994 (fset 'macroexpand #'cl--sm-macroexpand)
1995 ;; FIXME: For N bindings, this will traverse `body' N times! 1995 (let ((expansion
1996 (macroexpand-all (cons 'progn body) 1996 ;; FIXME: For N bindings, this will traverse `body'
1997 (cons (list (symbol-name (caar bindings)) 1997 ;; N times!
1998 (cl-cadar bindings)) 1998 (macroexpand-all (cons 'progn body)
1999 macroexpand-all-environment))) 1999 (cons (list (symbol-name (caar bindings))
2000 (cl-cadar bindings))
2001 macroexpand-all-environment))))
2002 (if (or (null (cdar bindings)) (cl-cddar bindings))
2003 (macroexp--warn-and-return
2004 (format "Malformed `cl-symbol-macrolet' binding: %S"
2005 (car bindings))
2006 expansion)
2007 expansion)))
2000 (fset 'macroexpand previous-macroexpand)))))) 2008 (fset 'macroexpand previous-macroexpand))))))
2001 2009
2002;;; Multiple values. 2010;;; Multiple values.
@@ -2726,7 +2734,7 @@ macro that returns its `&whole' argument."
2726 (let* ((cl-entry (cons (nth 1 (nth 1 cl-form)) nil)) 2734 (let* ((cl-entry (cons (nth 1 (nth 1 cl-form)) nil))
2727 (cl--active-block-names (cons cl-entry cl--active-block-names)) 2735 (cl--active-block-names (cons cl-entry cl--active-block-names))
2728 (cl-body (macroexpand-all ;Performs compiler-macro expansions. 2736 (cl-body (macroexpand-all ;Performs compiler-macro expansions.
2729 (cons 'progn (cddr cl-form)) 2737 (macroexp-progn (cddr cl-form))
2730 macroexpand-all-environment))) 2738 macroexpand-all-environment)))
2731 ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able 2739 ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able
2732 ;; to indicate that this return value is already fully expanded. 2740 ;; to indicate that this return value is already fully expanded.