Show
Ignore:
Timestamp:
2006年07月29日 07時48分34秒 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

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

    r4111 r4131  
    109109  (cons 'if (cons cond (cons nil body)))) 
    110110 
     111(defvar --dolist-tail-- nil 
     112  "Temporary variable used in `dolist' expansion.") 
     113 
    111114(defmacro dolist (spec &rest body) 
    112115  "Loop over a list. 
     
    116119\(fn (VAR LIST [RESULT]) BODY...)" 
    117120  (declare (indent 1) (debug ((symbolp form &optional form) body))) 
    118   (let ((temp (make-symbol "--dolist-temp--"))) 
     121  ;; It would be cleaner to create an uninterned symbol, 
     122  ;; but that uses a lot more space when many functions in many files 
     123  ;; use dolist. 
     124  (let ((temp '--dolist-tail--)) 
    119125    `(let ((,temp ,(nth 1 spec)) 
    120126           ,(car spec)) 
    121127       (while ,temp 
    122128         (setq ,(car spec) (car ,temp)) 
    123          (setq ,temp (cdr ,temp)) 
    124          ,@body
     129         ,@body 
     130         (setq ,temp (cdr ,temp))
    125131       ,@(if (cdr (cdr spec)) 
    126132             `((setq ,(car spec) nil) ,@(cdr (cdr spec))))))) 
     133 
     134(defvar --dotimes-limit-- nil 
     135  "Temporary variable used in `dotimes' expansion.") 
    127136 
    128137(defmacro dotimes (spec &rest body) 
     
    134143\(fn (VAR COUNT [RESULT]) BODY...)" 
    135144  (declare (indent 1) (debug dolist)) 
    136   (let ((temp (make-symbol "--dotimes-temp--")) 
     145  ;; It would be cleaner to create an uninterned symbol, 
     146  ;; but that uses a lot more space when many functions in many files 
     147  ;; use dotimes. 
     148  (let ((temp '--dotimes-limit--) 
    137149        (start 0) 
    138150        (end (nth 1 spec))) 
     
    17221734    (setq seconds (+ seconds (* 1e-3 nodisp))) 
    17231735    (setq nodisp obsolete)) 
    1724   (unless nodisp 
    1725     (redisplay)) 
    1726   (or (<= seconds 0) 
    1727       (let ((timer (timer-create)) 
    1728             (echo-keystrokes 0)) 
    1729         (if (catch 'sit-for-timeout 
    1730               (timer-set-time timer (timer-relative-time 
    1731                                      (current-time) seconds)) 
    1732               (timer-set-function timer 'with-timeout-handler 
    1733                                   '(sit-for-timeout)) 
    1734               (timer-activate timer) 
    1735               (push (read-event) unread-command-events) 
    1736               nil) 
    1737             t 
    1738           (cancel-timer timer) 
    1739           nil)))) 
     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)))))) 
    17401743  
    17411744;;; Atomic change groups. 
     
    25312534  "Return non-nil if text before point matches regular expression REGEXP. 
    25322535Like `looking-at' except matches before point, and is slower. 
    2533 LIMIT if non-nil speeds up the search by specifying how far back the 
    2534 match can start. 
     2536LIMIT if non-nil speeds up the search by specifying a minimum 
     2537starting position, to avoid checking matches that would start 
     2538before LIMIT. 
    25352539 
    25362540If GREEDY is non-nil, extend the match backwards as far as possible,