Changeset 4131 for trunk/lisp/subr.el
- Timestamp:
- 2006年07月29日 07時48分34秒 (2 years ago)
- Files:
-
- trunk/lisp/subr.el (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/subr.el
r4111 r4131 109 109 (cons 'if (cons cond (cons nil body)))) 110 110 111 (defvar --dolist-tail-- nil 112 "Temporary variable used in `dolist' expansion.") 113 111 114 (defmacro dolist (spec &rest body) 112 115 "Loop over a list. … … 116 119 \(fn (VAR LIST [RESULT]) BODY...)" 117 120 (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--)) 119 125 `(let ((,temp ,(nth 1 spec)) 120 126 ,(car spec)) 121 127 (while ,temp 122 128 (setq ,(car spec) (car ,temp)) 123 (setq ,temp (cdr ,temp))124 ,@body)129 ,@body 130 (setq ,temp (cdr ,temp))) 125 131 ,@(if (cdr (cdr spec)) 126 132 `((setq ,(car spec) nil) ,@(cdr (cdr spec))))))) 133 134 (defvar --dotimes-limit-- nil 135 "Temporary variable used in `dotimes' expansion.") 127 136 128 137 (defmacro dotimes (spec &rest body) … … 134 143 \(fn (VAR COUNT [RESULT]) BODY...)" 135 144 (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--) 137 149 (start 0) 138 150 (end (nth 1 spec))) … … 1722 1734 (setq seconds (+ seconds (* 1e-3 nodisp))) 1723 1735 (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)))))) 1740 1743 1741 1744 ;;; Atomic change groups. … … 2531 2534 "Return non-nil if text before point matches regular expression REGEXP. 2532 2535 Like `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. 2536 LIMIT if non-nil speeds up the search by specifying a minimum 2537 starting position, to avoid checking matches that would start 2538 before LIMIT. 2535 2539 2536 2540 If GREEDY is non-nil, extend the match backwards as far as possible,
