[Top][All Lists]

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

master 0732fc3: * lisp/frame.el Don't activate `blink-cursor-idle-timer`

From: Stefan Monnier
Subject: master 0732fc3: * lisp/frame.el Don't activate `blink-cursor-idle-timer` needlessly.
Date: Fri, 15 Jan 2021 23:18:14 -0500 (EST)

branch: master
commit 0732fc31932c75c682c8b65b4dcb4376ca63e8fd
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/frame.el Don't activate `blink-cursor-idle-timer` needlessly.
    (blink-cursor-mode): Use `blink-cursor-check` rather than
    `blink-cursor--start-idle-timer` so we check for the presence of
    a frame where the cursor can be blinked before activating the idle timer.
 lisp/frame.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/frame.el b/lisp/frame.el
index c712762..e2d7f21 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2557,7 +2557,7 @@ command starts, by installing a pre-command hook."
     ;; blink-cursor-end is not added to pre-command-hook.
     (setq blink-cursor-blinks-done 1)
-    (add-hook 'pre-command-hook 'blink-cursor-end)
+    (add-hook 'pre-command-hook #'blink-cursor-end)
     (internal-show-cursor nil nil)))
 (defun blink-cursor-timer-function ()
@@ -2572,14 +2572,14 @@ command starts, by installing a pre-command hook."
   (when (and (> blink-cursor-blinks 0)
              (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done))
-    (add-hook 'post-command-hook 'blink-cursor-check)))
+    (add-hook 'post-command-hook #'blink-cursor-check)))
 (defun blink-cursor-end ()
   "Stop cursor blinking.
 This is installed as a pre-command hook by `blink-cursor-start'.
 When run, it cancels the timer `blink-cursor-timer' and removes
 itself as a pre-command hook."
-  (remove-hook 'pre-command-hook 'blink-cursor-end)
+  (remove-hook 'pre-command-hook #'blink-cursor-end)
   (internal-show-cursor nil t)
   (when blink-cursor-timer
     (cancel-timer blink-cursor-timer)
@@ -2648,7 +2648,7 @@ terminals, cursor blinking is controlled by the terminal."
   (when blink-cursor-mode
     (add-function :after after-focus-change-function 
     (add-hook 'after-delete-frame-functions #'blink-cursor--rescan-frames)
-    (blink-cursor--start-idle-timer)))
+    (blink-cursor-check)))
 ;; Frame maximization/fullscreen

reply via email to

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