emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115013: * lisp/emacs-lisp/cl-macs.el (cl-symbol-mac


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115013: * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for
Date: Thu, 07 Nov 2013 04:38:04 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115013
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15814
author: Nathan Trapuzzano <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-11-06 23:38:00 -0500
message:
  * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for
  malformed bindings form.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/cl-macs.el     clmacs.el-20091113204419-o5vbwnq5f7feedwu-612
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-11-07 03:02:01 +0000
+++ b/lisp/ChangeLog    2013-11-07 04:38:00 +0000
@@ -1,10 +1,14 @@
+2013-11-05  Nathan Trapuzzano  <address@hidden>  (tiny change)
+
+       * emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for
+       malformed bindings form (bug#15814).
+
 2013-11-07  Dmitry Gutov  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of
        "." compared to " @ ".  This incidentally fixes some indentation
        examples with "do".
-       (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or
-       "or".
+       (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or "or".
        (ruby-smie-grammar): New tokens: "and" and "or".
        (ruby-smie--args-separator-p): Fix the check for tokens at POS.
        Exclude "and" and "or".  Remove "do" in order to work around token

=== modified file 'lisp/emacs-lisp/cl-macs.el'
--- a/lisp/emacs-lisp/cl-macs.el        2013-09-28 01:07:18 +0000
+++ b/lisp/emacs-lisp/cl-macs.el        2013-11-07 04:38:00 +0000
@@ -1992,11 +1992,19 @@
       (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 @@
   (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.


reply via email to

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