mirror of
https://github.com/larstvei/Focus.git
synced 2024-11-26 03:28:32 +00:00
Added function for briefly showing the cursor
This commit is contained in:
parent
a723f78dc4
commit
b21341bd40
12
focus.el
12
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)))
|
(when (and focus-read-only-mode (not (null focus-read-only-blink-timer)))
|
||||||
(setq focus-read-only-blink-timer nil)
|
(setq focus-read-only-blink-timer nil)
|
||||||
(setq cursor-type 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
|
;;;###autoload
|
||||||
(define-minor-mode focus-mode
|
(define-minor-mode focus-mode
|
||||||
"Dim the font color of text in surrounding sections."
|
"Dim the font color of text in surrounding sections."
|
||||||
|
Loading…
Reference in New Issue
Block a user