From fcecceea0fd32073e8d0496ca841e6db8b18b2ad Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 3 Oct 2006 09:19:17 +0000 Subject: [PATCH] (pushnew-internal): Remove defvar. (pushnew): Fix last change. --- lisp/emacs-lisp/cl.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 3399f7e7b20..d2d68189230 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -149,8 +149,6 @@ be a symbol, or any generalized variable allowed by `setf'." (if (symbolp place) (list 'setq place (list 'cons x place)) (list 'callf2 'cons x place))) -(defvar pushnew-internal) - (defmacro pushnew (x place &rest keys) "(pushnew X PLACE): insert X at the head of the list if not already there. Like (push X PLACE), except that the list is unmodified if X is `eql' to @@ -159,7 +157,8 @@ an element already on the list. \n(fn X PLACE [KEYWORD VALUE]...)" (if (symbolp place) (if (null keys) - `(if (memql ,x ,place) ,place (setq ,place (cons ,x ,place))) + `(let ((x ,x)) + (if (memql x ,place) ,place (setq ,place (cons x ,place)))) (list 'setq place (list* 'adjoin x place keys))) (list* 'callf2 'adjoin x place keys))) -- 2.39.2