summaryrefslogtreecommitdiff
path: root/lisp/type-break.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-10-27 15:04:26 +0000
committerRichard M. Stallman <rms@gnu.org>2004-10-27 15:04:26 +0000
commit5d6101401f6f57d150a33f46e11f3efab815e5df (patch)
tree22c5152f0235053c73faf0c46d77998d6d26827b /lisp/type-break.el
parent31eb6fd7683a16822f65c2a8bf97869e4a0484a5 (diff)
downloademacs-5d6101401f6f57d150a33f46e11f3efab815e5df.tar.gz
(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.
Diffstat (limited to 'lisp/type-break.el')
-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
(setcar type-break-keystroke-threshold lower)
(setcdr type-break-keystroke-threshold upper)
(if (interactive-p)
- (message "min threshold: %d\tmax threshold: %d" lower upper)
- type-break-keystroke-threshold)))
+ (message "min threshold: %d\tmax threshold: %d" lower upper))
+ type-break-keystroke-threshold))
;;; misc functions
@@ -1103,37 +1103,12 @@ With optional non-nil ALL, force redisplay of all mode-lines."
(defun type-break-run-at-time (time repeat function)
(condition-case nil (or (require 'timer) (require 'itimer)) (error nil))
- (cond ((fboundp 'run-at-time)
- (run-at-time time repeat function))
- ((fboundp 'start-timer)
- (let ((name (if (symbolp function)
- (symbol-name function)
- "type-break")))
- (start-timer name function time repeat)))
- ((fboundp 'start-itimer)
- (let ((name (if (symbolp function)
- (symbol-name function)
- "type-break")))
- (start-itimer name function time repeat)))))
+ (run-at-time time repeat function))
(defvar timer-dont-exit)
(defun type-break-cancel-function-timers (function)
- (cond ((fboundp 'cancel-function-timers)
- (let ((timer-dont-exit t))
- (cancel-function-timers function)))
- ((fboundp 'delete-timer)
- (let ((list timer-list))
- (while list
- (and (eq (funcall 'timer-function (car list)) function)
- (delete-timer (car list)))
- (setq list (cdr list)))))
- ((fboundp 'delete-itimer)
- (with-no-warnings
- (let ((list itimer-list))
- (while list
- (and (eq (funcall 'itimer-function (car list)) function)
- (delete-itimer (car list)))
- (setq list (cdr list))))))))
+ (let ((timer-dont-exit t))
+ (cancel-function-timers function)))
;;; Demo wrappers