aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-10-27 15:04:26 +0000
committerRichard M. Stallman2004-10-27 15:04:26 +0000
commit5d6101401f6f57d150a33f46e11f3efab815e5df (patch)
tree22c5152f0235053c73faf0c46d77998d6d26827b
parent31eb6fd7683a16822f65c2a8bf97869e4a0484a5 (diff)
downloademacs-5d6101401f6f57d150a33f46e11f3efab815e5df.tar.gz
emacs-5d6101401f6f57d150a33f46e11f3efab815e5df.zip
(type-break-run-at-time): Always use run-at-time; forget the alternatives.
(type-break-cancel-function-timers): Always use cancel-function-timers; forget the alternatives.
-rw-r--r--lisp/type-break.el35
1 files changed, 5 insertions, 30 deletions
diff --git a/lisp/type-break.el b/lisp/type-break.el
index 253e1406f06..ec96ab09fe2 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -1005,8 +1005,8 @@ FRAC should be the inverse of the fractional value; for example, a value of
1005 (setcar type-break-keystroke-threshold lower) 1005 (setcar type-break-keystroke-threshold lower)
1006 (setcdr type-break-keystroke-threshold upper) 1006 (setcdr type-break-keystroke-threshold upper)
1007 (if (interactive-p) 1007 (if (interactive-p)
1008 (message "min threshold: %d\tmax threshold: %d" lower upper) 1008 (message "min threshold: %d\tmax threshold: %d" lower upper))
1009 type-break-keystroke-threshold))) 1009 type-break-keystroke-threshold))
1010 1010
1011 1011
1012;;; misc functions 1012;;; misc functions
@@ -1103,37 +1103,12 @@ With optional non-nil ALL, force redisplay of all mode-lines."
1103 1103
1104(defun type-break-run-at-time (time repeat function) 1104(defun type-break-run-at-time (time repeat function)
1105 (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) 1105 (condition-case nil (or (require 'timer) (require 'itimer)) (error nil))
1106 (cond ((fboundp 'run-at-time) 1106 (run-at-time time repeat function))
1107 (run-at-time time repeat function))
1108 ((fboundp 'start-timer)
1109 (let ((name (if (symbolp function)
1110 (symbol-name function)
1111 "type-break")))
1112 (start-timer name function time repeat)))
1113 ((fboundp 'start-itimer)
1114 (let ((name (if (symbolp function)
1115 (symbol-name function)
1116 "type-break")))
1117 (start-itimer name function time repeat)))))
1118 1107
1119(defvar timer-dont-exit) 1108(defvar timer-dont-exit)
1120(defun type-break-cancel-function-timers (function) 1109(defun type-break-cancel-function-timers (function)
1121 (cond ((fboundp 'cancel-function-timers) 1110 (let ((timer-dont-exit t))
1122 (let ((timer-dont-exit t)) 1111 (cancel-function-timers function)))
1123 (cancel-function-timers function)))
1124 ((fboundp 'delete-timer)
1125 (let ((list timer-list))
1126 (while list
1127 (and (eq (funcall 'timer-function (car list)) function)
1128 (delete-timer (car list)))
1129 (setq list (cdr list)))))
1130 ((fboundp 'delete-itimer)
1131 (with-no-warnings
1132 (let ((list itimer-list))
1133 (while list
1134 (and (eq (funcall 'itimer-function (car list)) function)
1135 (delete-itimer (car list)))
1136 (setq list (cdr list))))))))
1137 1112
1138 1113
1139;;; Demo wrappers 1114;;; Demo wrappers