# HG changeset patch # User Chong Yidong # Date 1156085009 0 # Node ID 94094ff1136482b788b891afc4d2da14e46143eb # Parent 1b7664312e38b2afe17f55ab1560f85959834bd7 * frame.el (blink-cursor-start): Set timer first. (blink-cursor-end): Ignore timer cancelling errors. Suggested by Ken Manheimer. diff -r 1b7664312e38 -r 94094ff11364 lisp/ChangeLog --- a/lisp/ChangeLog Sun Aug 20 12:53:20 2006 +0000 +++ b/lisp/ChangeLog Sun Aug 20 14:43:29 2006 +0000 @@ -1,3 +1,9 @@ +2006-08-20 Chong Yidong + + * frame.el (blink-cursor-start): Set timer first. + (blink-cursor-end): Ignore timer cancelling errors. + Suggested by Ken Manheimer. + 2006-08-20 Juanma Barranquero * newcomment.el (comment-box): Call `comment-normalize-vars'. diff -r 1b7664312e38 -r 94094ff11364 lisp/frame.el --- a/lisp/frame.el Sun Aug 20 12:53:20 2006 +0000 +++ b/lisp/frame.el Sun Aug 20 14:43:29 2006 +0000 @@ -1291,11 +1291,13 @@ if appropriate. It also arranges to cancel that timer when the next command starts, by installing a pre-command hook." (when (null blink-cursor-timer) - (add-hook 'pre-command-hook 'blink-cursor-end) - (internal-show-cursor nil nil) + ;; Set up the timer first, so that if this signals an error, + ;; blink-cursor-end is not added to pre-command-hook. (setq blink-cursor-timer (run-with-timer blink-cursor-interval blink-cursor-interval - 'blink-cursor-timer-function)))) + 'blink-cursor-timer-function)) + (add-hook 'pre-command-hook 'blink-cursor-end) + (internal-show-cursor nil nil))) (defun blink-cursor-timer-function () "Timer function of timer `blink-cursor-timer'." @@ -1308,10 +1310,11 @@ itself as a pre-command hook." (remove-hook 'pre-command-hook 'blink-cursor-end) (internal-show-cursor nil t) - (cancel-timer blink-cursor-timer) + (condition-case nil + (cancel-timer blink-cursor-timer) + (error nil)) (setq blink-cursor-timer nil)) - ;; Hourglass pointer