aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-09-23 17:25:55 +0300
committerEli Zaretskii2016-09-23 17:25:55 +0300
commitf2819241bc93b641f13e1a04f3520fadb8ed53a8 (patch)
tree3a6e010fce25b3d824fb129ea90d3b29b8b41299
parent7cb120ebf397c51540ebb4ef223d84852394ed58 (diff)
downloademacs-f2819241bc93b641f13e1a04f3520fadb8ed53a8.tar.gz
emacs-f2819241bc93b641f13e1a04f3520fadb8ed53a8.zip
Fix display of cursor when 'blink-cursor-delay' has small value
* lisp/frame.el (blink-cursor-check, blink-cursor-mode): Protect ourselves against too small values of blink-cursor-delay. This avoids erratic display of the cursor, or even failure to display it, when user types text at high speed or leans on a key to invoke the keyboard auto-repeat feature. (Bug#24372)
-rw-r--r--lisp/frame.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 09738d1e2ed..291150b591b 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2115,7 +2115,11 @@ This is done when a frame gets focus. Blink timers may be stopped by
2115 (not blink-cursor-idle-timer)) 2115 (not blink-cursor-idle-timer))
2116 (remove-hook 'post-command-hook 'blink-cursor-check) 2116 (remove-hook 'post-command-hook 'blink-cursor-check)
2117 (setq blink-cursor-idle-timer 2117 (setq blink-cursor-idle-timer
2118 (run-with-idle-timer blink-cursor-delay 2118 ;; The 0.2 sec limitation from below is to avoid erratic
2119 ;; behavior (or downright failure to display the cursor
2120 ;; during command execution) if they set blink-cursor-delay
2121 ;; to a very small or even zero value.
2122 (run-with-idle-timer (max 0.2 blink-cursor-delay)
2119 blink-cursor-delay 2123 blink-cursor-delay
2120 'blink-cursor-start)))) 2124 'blink-cursor-start))))
2121 2125
@@ -2149,7 +2153,11 @@ terminals, cursor blinking is controlled by the terminal."
2149 (add-hook 'focus-in-hook #'blink-cursor-check) 2153 (add-hook 'focus-in-hook #'blink-cursor-check)
2150 (add-hook 'focus-out-hook #'blink-cursor-suspend) 2154 (add-hook 'focus-out-hook #'blink-cursor-suspend)
2151 (setq blink-cursor-idle-timer 2155 (setq blink-cursor-idle-timer
2152 (run-with-idle-timer blink-cursor-delay 2156 ;; The 0.2 sec limitation from below is to avoid erratic
2157 ;; behavior (or downright failure to display the cursor
2158 ;; during command execution) if they set blink-cursor-delay
2159 ;; to a very small or even zero value.
2160 (run-with-idle-timer (max 0.2 blink-cursor-delay)
2153 blink-cursor-delay 2161 blink-cursor-delay
2154 #'blink-cursor-start)))) 2162 #'blink-cursor-start))))
2155 2163