emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/cl.el,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/cl.el,v
Date: Sun, 10 Sep 2006 17:47:39 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       06/09/10 17:47:39

Index: cl.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/cl.el,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- cl.el       6 Feb 2006 12:20:06 -0000       1.48
+++ cl.el       10 Sep 2006 17:47:39 -0000      1.49
@@ -149,13 +149,20 @@
   (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
 an element already on the list.
 \nKeywords supported:  :test :test-not :key
 \n(fn X PLACE [KEYWORD VALUE]...)"
-  (if (symbolp place) (list 'setq place (list* 'adjoin x place keys))
+  (if (symbolp place)
+      (if (null keys)
+         `(let ((pushnew-internal ,place))
+            (add-to-list 'pushnew-internal x nil 'eql)
+            (setq ,place pushnew-internal))
+       (list 'setq place (list* 'adjoin x place keys)))
     (list* 'callf2 'adjoin x place keys)))
 
 (defun cl-set-elt (seq n val)




reply via email to

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