emacs-diffs
[Top][All Lists]
Advanced

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

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


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

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

Index: subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.523
retrieving revision 1.524
diff -u -b -r1.523 -r1.524
--- subr.el     26 Jul 2006 18:18:26 -0000      1.523
+++ subr.el     10 Sep 2006 17:45:42 -0000      1.524
@@ -1085,9 +1085,10 @@
            (kill-local-variable hook)
          (set hook hook-value))))))
 
-(defun add-to-list (list-var element &optional append)
+(defun add-to-list (list-var element &optional append compare-fn)
   "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
-The test for presence of ELEMENT is done with `equal'.
+The test for presence of ELEMENT is done with `equal',
+or with COMPARE-FN if that's non-nil.
 If ELEMENT is added, it is added at the beginning of the list,
 unless the optional argument APPEND is non-nil, in which case
 ELEMENT is added at the end.
@@ -1099,7 +1100,13 @@
 into a hook function that will be run only after loading the package.
 `eval-after-load' provides one way to do this.  In some cases
 other hooks, such as major mode hooks, can do the job."
-  (if (member element (symbol-value list-var))
+  (if (if compare-fn
+         (let (present)
+           (dolist (elt (symbol-value list-var))
+             (if (funcall compare-fn element elt)
+                 (setq present t)))
+           present)
+       (member element (symbol-value list-var)))
       (symbol-value list-var)
     (set list-var
         (if append
@@ -1730,6 +1737,10 @@
 floating point support.
 
 \(fn SECONDS &optional NODISP)"
+  (unless (or unread-command-events
+             unread-post-input-method-events
+             unread-input-method-events
+             (>= unread-command-char 0))
   (when (or obsolete (numberp nodisp))
     (setq seconds (+ seconds (* 1e-3 nodisp)))
     (setq nodisp obsolete))
@@ -1739,7 +1750,7 @@
     (or (<= seconds 0)
        (let ((read (read-event nil nil seconds)))
          (or (null read)
-             (progn (push read unread-command-events) nil))))))
+               (progn (push read unread-command-events) nil)))))))
 
 ;;; Atomic change groups.
 




reply via email to

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