emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/focus b21341bd40 38/82: Added function for briefly showing


From: ELPA Syncer
Subject: [nongnu] elpa/focus b21341bd40 38/82: Added function for briefly showing the cursor
Date: Tue, 6 Sep 2022 04:58:56 -0400 (EDT)

branch: elpa/focus
commit b21341bd40561165b13c72378cb2fb66836409cc
Author: Lars Tveito <larstvei@ifi.uio.no>
Commit: Lars Tveito <larstvei@ifi.uio.no>

    Added function for briefly showing the cursor
---
 focus.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/focus.el b/focus.el
index 0c63baff47..4a76846b41 100644
--- a/focus.el
+++ b/focus.el
@@ -183,6 +183,18 @@ when `focus-read-only-mode' is activated."
     (when (and focus-read-only-mode (not (null focus-read-only-blink-timer)))
         (setq focus-read-only-blink-timer nil)
         (setq cursor-type nil))))
+
+(defun focus-read-only-cursor-blink ()
+  "Make the cursor visible for `focus-read-only-blink-seconds'.
+This is added to the `pre-command-hook' when
+`focus-read-only-mode' is active."
+  (when (and focus-read-only-mode
+             (not (member last-command '(focus-next-thing focus-prev-thing))))
+    (when focus-read-only-blink-timer (cancel-timer 
focus-read-only-blink-timer))
+    (setq cursor-type t)
+    (setq focus-read-only-blink-timer
+          (run-at-time focus-read-only-blink-seconds nil
+                       'focus-read-only-hide-cursor (current-buffer)))))
 ;;;###autoload
 (define-minor-mode focus-mode
   "Dim the font color of text in surrounding sections."



reply via email to

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