emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 f281924: Fix display of cursor when 'blink-cursor


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 f281924: Fix display of cursor when 'blink-cursor-delay' has small value
Date: Fri, 23 Sep 2016 14:28:59 +0000 (UTC)

branch: emacs-25
commit f2819241bc93b641f13e1a04f3520fadb8ed53a8
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/frame.el |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/frame.el b/lisp/frame.el
index 09738d1..291150b 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
             (not blink-cursor-idle-timer))
     (remove-hook 'post-command-hook 'blink-cursor-check)
     (setq blink-cursor-idle-timer
-          (run-with-idle-timer blink-cursor-delay
+          ;; The 0.2 sec limitation from below is to avoid erratic
+          ;; behavior (or downright failure to display the cursor
+          ;; during command execution) if they set blink-cursor-delay
+          ;; to a very small or even zero value.
+          (run-with-idle-timer (max 0.2 blink-cursor-delay)
                                blink-cursor-delay
                                'blink-cursor-start))))
 
@@ -2149,7 +2153,11 @@ terminals, cursor blinking is controlled by the 
terminal."
     (add-hook 'focus-in-hook #'blink-cursor-check)
     (add-hook 'focus-out-hook #'blink-cursor-suspend)
     (setq blink-cursor-idle-timer
-          (run-with-idle-timer blink-cursor-delay
+          ;; The 0.2 sec limitation from below is to avoid erratic
+          ;; behavior (or downright failure to display the cursor
+          ;; during command execution) if they set blink-cursor-delay
+          ;; to a very small or even zero value.
+          (run-with-idle-timer (max 0.2 blink-cursor-delay)
                                blink-cursor-delay
                                #'blink-cursor-start))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]