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

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

[nongnu] elpa/focus a723f78dc4 37/82: Added function for hiding the curs


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

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

    Added function for hiding the cursor
---
 focus.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/focus.el b/focus.el
index 335eab0b08..0c63baff47 100644
--- a/focus.el
+++ b/focus.el
@@ -174,6 +174,15 @@ deleted, and `focus-move-focus' is removed from 
`post-command-hook'."
   "Moves the point to the middle of the Nth previous thing."
   (interactive "p")
   (focus-next-thing (- (+ 2 n))))
+
+(defun focus-read-only-hide-cursor (&optional buffer)
+  "Hide the cursor.
+This function is triggered by the `focus-read-only-blink-timer',
+when `focus-read-only-mode' is activated."
+  (with-current-buffer (or buffer (current-buffer))
+    (when (and focus-read-only-mode (not (null focus-read-only-blink-timer)))
+        (setq focus-read-only-blink-timer nil)
+        (setq cursor-type nil))))
 ;;;###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]