1005 |
(setcar type-break-keystroke-threshold lower) |
(setcar type-break-keystroke-threshold lower) |
1006 |
(setcdr type-break-keystroke-threshold upper) |
(setcdr type-break-keystroke-threshold upper) |
1007 |
(if (interactive-p) |
(if (interactive-p) |
1008 |
(message "min threshold: %d\tmax threshold: %d" lower upper) |
(message "min threshold: %d\tmax threshold: %d" lower upper)) |
1009 |
type-break-keystroke-threshold))) |
type-break-keystroke-threshold)) |
1010 |
|
|
1011 |
|
|
1012 |
;;; misc functions |
;;; misc functions |
1103 |
|
|
1104 |
(defun type-break-run-at-time (time repeat function) |
(defun type-break-run-at-time (time repeat function) |
1105 |
(condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) |
(condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) |
1106 |
(cond ((fboundp 'run-at-time) |
(run-at-time time repeat function)) |
|
(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))))) |
|
1107 |
|
|
1108 |
(defvar timer-dont-exit) |
(defvar timer-dont-exit) |
1109 |
(defun type-break-cancel-function-timers (function) |
(defun type-break-cancel-function-timers (function) |
1110 |
(cond ((fboundp 'cancel-function-timers) |
(let ((timer-dont-exit t)) |
1111 |
(let ((timer-dont-exit t)) |
(cancel-function-timers function))) |
|
(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)))))))) |
|
1112 |
|
|
1113 |
|
|
1114 |
;;; Demo wrappers |
;;; Demo wrappers |