diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2012-06-29 01:04:27 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2012-06-29 01:04:27 +0200 |
commit | 2badeec4f436028eaf88ea6929f3223e7db38839 (patch) | |
tree | ec36fd02fd08f6810f39e32fe275fb1912f7d2ea /lisp/emacs-lisp | |
parent | 7d7e0027e7c7ad6584fd44c611b3c77be69391a9 (diff) | |
download | emacs-2badeec4f436028eaf88ea6929f3223e7db38839.tar.gz emacs-2badeec4f436028eaf88ea6929f3223e7db38839.tar.bz2 emacs-2badeec4f436028eaf88ea6929f3223e7db38839.zip |
lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 990e66d91aa..34351e4830f 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -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))) |