Added function for briefly showing the cursor

This commit is contained in:
Lars Tveito 2015-05-24 02:04:02 +02:00
parent a723f78dc4
commit b21341bd40

View File

@ -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."