Show
Ignore:
Timestamp:
09/18/06 20:48:14 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/subr.el

    r4131 r4166  
    10861086          (set hook hook-value)))))) 
    10871087 
    1088 (defun add-to-list (list-var element &optional append
     1088(defun add-to-list (list-var element &optional append compare-fn
    10891089  "Add ELEMENT to the value of LIST-VAR if it isn't there yet. 
    1090 The test for presence of ELEMENT is done with `equal'. 
     1090The test for presence of ELEMENT is done with `equal', 
     1091or with COMPARE-FN if that's non-nil. 
    10911092If ELEMENT is added, it is added at the beginning of the list, 
    10921093unless the optional argument APPEND is non-nil, in which case 
     
    11001101`eval-after-load' provides one way to do this.  In some cases 
    11011102other hooks, such as major mode hooks, can do the job." 
    1102   (if (member element (symbol-value list-var)) 
     1103  (if (if compare-fn 
     1104          (let (present) 
     1105            (dolist (elt (symbol-value list-var)) 
     1106              (if (funcall compare-fn element elt) 
     1107                  (setq present t))) 
     1108            present) 
     1109        (member element (symbol-value list-var))) 
    11031110      (symbol-value list-var) 
    11041111    (set list-var 
     
    17341741    (setq seconds (+ seconds (* 1e-3 nodisp))) 
    17351742    (setq nodisp obsolete)) 
    1736   (if noninteractive 
    1737       (progn (sleep-for seconds) t) 
    1738     (unless nodisp (redisplay)) 
    1739     (or (<= seconds 0) 
    1740         (let ((read (read-event nil nil seconds))) 
    1741           (or (null read) 
    1742               (progn (push read unread-command-events) nil)))))) 
     1743  (cond 
     1744   (noninteractive 
     1745    (sleep-for seconds) 
     1746    t) 
     1747   ((input-pending-p) 
     1748    nil) 
     1749   ((<= seconds 0) 
     1750    (or nodisp (redisplay))) 
     1751   (t 
     1752    (or nodisp (redisplay)) 
     1753    (let ((read (read-event nil nil seconds))) 
     1754      (or (null read) 
     1755          (progn (push read unread-command-events) 
     1756                 nil)))))) 
    17431757  
    17441758;;; Atomic change groups. 
     
    23882402       (catch ',catch-sym 
    23892403         (let ((throw-on-input ',catch-sym)) 
    2390            (or (not (sit-for 0 0 t)
    2391              ,@body)))))) 
     2404           (or (input-pending-p
     2405               ,@body)))))) 
    23922406 
    23932407(defmacro combine-after-change-calls (&rest body)