diff options
| author | Chong Yidong | 2006-08-20 14:43:29 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-08-20 14:43:29 +0000 |
| commit | f9ac92c539946ca1f4dc77e044dd05708c71e03d (patch) | |
| tree | 508f76602a3188e6be07b62a40a7851e114b61c7 | |
| parent | 525efc448c2e574527761c8650a39c182d609788 (diff) | |
| download | emacs-f9ac92c539946ca1f4dc77e044dd05708c71e03d.tar.gz emacs-f9ac92c539946ca1f4dc77e044dd05708c71e03d.zip | |
* frame.el (blink-cursor-start): Set timer first.
(blink-cursor-end): Ignore timer cancelling errors.
Suggested by Ken Manheimer.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/frame.el | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7052812ddd0..9214570678c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2006-08-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * frame.el (blink-cursor-start): Set timer first. | ||
| 4 | (blink-cursor-end): Ignore timer cancelling errors. | ||
| 5 | Suggested by Ken Manheimer. | ||
| 6 | |||
| 1 | 2006-08-20 Juanma Barranquero <lekktu@gmail.com> | 7 | 2006-08-20 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * newcomment.el (comment-box): Call `comment-normalize-vars'. | 9 | * newcomment.el (comment-box): Call `comment-normalize-vars'. |
diff --git a/lisp/frame.el b/lisp/frame.el index a92fa3c8133..873cec6c783 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1291,11 +1291,13 @@ This starts the timer `blink-cursor-timer', which makes the cursor blink | |||
| 1291 | if appropriate. It also arranges to cancel that timer when the next | 1291 | if appropriate. It also arranges to cancel that timer when the next |
| 1292 | command starts, by installing a pre-command hook." | 1292 | command starts, by installing a pre-command hook." |
| 1293 | (when (null blink-cursor-timer) | 1293 | (when (null blink-cursor-timer) |
| 1294 | (add-hook 'pre-command-hook 'blink-cursor-end) | 1294 | ;; Set up the timer first, so that if this signals an error, |
| 1295 | (internal-show-cursor nil nil) | 1295 | ;; blink-cursor-end is not added to pre-command-hook. |
| 1296 | (setq blink-cursor-timer | 1296 | (setq blink-cursor-timer |
| 1297 | (run-with-timer blink-cursor-interval blink-cursor-interval | 1297 | (run-with-timer blink-cursor-interval blink-cursor-interval |
| 1298 | 'blink-cursor-timer-function)))) | 1298 | 'blink-cursor-timer-function)) |
| 1299 | (add-hook 'pre-command-hook 'blink-cursor-end) | ||
| 1300 | (internal-show-cursor nil nil))) | ||
| 1299 | 1301 | ||
| 1300 | (defun blink-cursor-timer-function () | 1302 | (defun blink-cursor-timer-function () |
| 1301 | "Timer function of timer `blink-cursor-timer'." | 1303 | "Timer function of timer `blink-cursor-timer'." |
| @@ -1308,10 +1310,11 @@ When run, it cancels the timer `blink-cursor-timer' and removes | |||
| 1308 | itself as a pre-command hook." | 1310 | itself as a pre-command hook." |
| 1309 | (remove-hook 'pre-command-hook 'blink-cursor-end) | 1311 | (remove-hook 'pre-command-hook 'blink-cursor-end) |
| 1310 | (internal-show-cursor nil t) | 1312 | (internal-show-cursor nil t) |
| 1311 | (cancel-timer blink-cursor-timer) | 1313 | (condition-case nil |
| 1314 | (cancel-timer blink-cursor-timer) | ||
| 1315 | (error nil)) | ||
| 1312 | (setq blink-cursor-timer nil)) | 1316 | (setq blink-cursor-timer nil)) |
| 1313 | 1317 | ||
| 1314 | |||
| 1315 | 1318 | ||
| 1316 | ;; Hourglass pointer | 1319 | ;; Hourglass pointer |
| 1317 | 1320 | ||