* lisp/emacs-lisp/cl-lib.el (cl-pushnew): Use macroexp-let2.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 30 Jun 2012 02:00:08 +0000 (22:00 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 30 Jun 2012 02:00:08 +0000 (22:00 -0400)
lisp/ChangeLog
lisp/emacs-lisp/cl-lib.el

index 064b141..f2fa5a3 100644 (file)
@@ -1,3 +1,7 @@
+2012-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl-lib.el (cl-pushnew): Use macroexp-let2.
+
 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * fringe.el (fringe-mode): Doc fix.
index 34351e4..51402f2 100644 (file)
@@ -151,16 +151,15 @@ an element already on the list.
                   [keywordp form])))
   (if (symbolp place)
       (if (null keys)
-         (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)))))
+          (macroexp-let2 nil 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)))