]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 28 Jun 2012 23:04:27 +0000 (01:04 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 28 Jun 2012 23:04:27 +0000 (01:04 +0200)
lisp/ChangeLog
lisp/emacs-lisp/cl-lib.el

index 26b6c6fd3226942a19de32762cd4c5ff0348c81e..e083b628cde929bd6074d1c192c341eab22d50bf 100644 (file)
@@ -1,3 +1,7 @@
+2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
+
 2012-06-28  Julien Danjou  <julien@danjou.info>
 
        * term.el (term-handle-colors-array): Use a set of new faces to
index 990e66d91aa1b9d70cd13fc797d519e8b6211a39..34351e4830ffc0b00d59322f6564cd077e3c798d 100644 (file)
@@ -151,15 +151,16 @@ an element already on the list.
                   [keywordp form])))
   (if (symbolp place)
       (if (null keys)
-         `(let ((x ,x))
-            (if (memql x ,place)
-                 ;; This symbol may later on expand to actual code which then
-                 ;; trigger warnings like "value unused" since cl-pushnew's return
-                 ;; value is rarely used.  It should not matter that other
-                 ;; warnings may be silenced, since `place' is used earlier and
-                 ;; should have triggered them already.
-                 (with-no-warnings ,place)
-               (setq ,place (cons x ,place))))
+         (let ((var (make-symbol "--cl-x--")))
+           `(let ((,var ,x))
+              (if (memql ,var ,place)
+                  ;; This symbol may later on expand to actual code which then
+                  ;; trigger warnings like "value unused" since cl-pushnew's return
+                  ;; value is rarely used.  It should not matter that other
+                  ;; warnings may be silenced, since `place' is used earlier and
+                  ;; should have triggered them already.
+                  (with-no-warnings ,place)
+                (setq ,place (cons ,var ,place)))))
        (list 'setq place (cl-list* 'cl-adjoin x place keys)))
     (cl-list* 'cl-callf2 'cl-adjoin x place keys)))