]> code.delx.au - gnu-emacs-elpa/blobdiff - beacon.el
Add beacon-dont-blink-commands
[gnu-emacs-elpa] / beacon.el
index d9f239668b945df57de61cdd407b91fc59cac9e7..ab8b469b888deafd1199f39be6ba4ca9e5aebf49 100644 (file)
--- a/beacon.el
+++ b/beacon.el
@@ -28,8 +28,8 @@
 ;; │ (beacon-mode 1)
 ;; └────
 ;;
-;; Whenever the window scrolls or you switch buffer a light will shine on
-;; top of your cursor so you know where it is.
+;; Whenever the window scrolls a light will shine on top of your cursor so
+;; you know where it is.
 ;;
 ;; That’s it.
 ;;
@@ -45,8 +45,7 @@
 ;;
 ;;   • To customize /when/ the beacon should blink at all, configure
 ;;     `beacon-blink-when-window-scrolls',
-;;     `beacon-blink-when-window-changes',
-;;     `beacon-blink-when-buffer-changes', and
+;;     `beacon-blink-when-window-changes', and
 ;;     `beacon-blink-when-point-moves'.
 ;;
 ;;   • To prevent the beacon from blinking only on some major-modes,
@@ -128,13 +127,20 @@ non-nil, the beacon will not blink."
 (add-hook 'beacon-dont-blink-predicates (lambda () (bound-and-true-p hl-line-mode)))
 (add-hook 'beacon-dont-blink-predicates #'window-minibuffer-p)
 
-(defcustom beacon-dont-blink-major-modes nil
+(defcustom beacon-dont-blink-major-modes '(magit-status-mode)
   "A list of major-modes where the beacon won't blink.
 Whenever the current buffer satisfies `derived-mode-p' for
 one of the major-modes on this list, the beacon will not
 blink."
   :type '(repeat symbol))
 
+(defcustom beacon-dont-blink-commands '(recenter-top-bottom)
+  "A list of commands that should not make the beacon blink.
+Use this for commands that scroll the window in very
+predictable ways, when the blink would be more distracting
+than helpful.."
+  :type '(repeat symbol))
+
 \f
 ;;; Overlays
 (defvar beacon--ovs nil)
@@ -260,7 +266,8 @@ Only returns `beacon-size' elements."
   (beacon--vanish)
   (unless (or (not beacon-mode)
               (run-hook-with-args-until-success 'beacon-dont-blink-predicates)
-              (seq-find #'derived-mode-p beacon-dont-blink-major-modes))
+              (seq-find #'derived-mode-p beacon-dont-blink-major-modes)
+              (memq (or this-command last-command) beacon-dont-blink-commands))
     (beacon--shine)
     (setq beacon--timer
           (run-at-time beacon-blink-delay