branch: master commit 2405d7a15c976f1b6768660556839ac3fd78f887 Merge: 64a30e7 c9d8645 Author: Artur Malabarba <bruce.connor...@gmail.com> Commit: Artur Malabarba <bruce.connor...@gmail.com>
Merge commit 'c9d86457d43decf61810006752544d7f7bd5a61d' --- packages/beacon/beacon.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/beacon/beacon.el b/packages/beacon/beacon.el index 9a3edac..2c33d5e 100644 --- a/packages/beacon/beacon.el +++ b/packages/beacon/beacon.el @@ -5,7 +5,7 @@ ;; Author: Artur Malabarba <em...@endlessparentheses.com> ;; URL: https://github.com/Malabarba/beacon ;; Keywords: convenience -;; Version: 1.3.1 +;; Version: 1.3.2 ;; Package-Requires: ((seq "2.14")) ;; This program is free software; you can redistribute it and/or modify @@ -147,7 +147,13 @@ For instance, if you want to disable beacon on buffers where (add-hook \\='beacon-dont-blink-predicates (lambda () (bound-and-true-p hl-line-mode)))") +(defun beacon--compilation-mode-p () + "Non-nil if this is some form of compilation mode." + (or (derived-mode-p 'compilation-mode) + (bound-and-true-p compilation-minor-mode))) + (add-hook 'beacon-dont-blink-predicates #'window-minibuffer-p) +(add-hook 'beacon-dont-blink-predicates #'beacon--compilation-mode-p) (defcustom beacon-dont-blink-major-modes '(t magit-status-mode magit-popup-mode inf-ruby-mode @@ -280,9 +286,10 @@ Only returns `beacon-size' elements." (color-distance "white" bg))) (make-list 3 (* beacon-color 65535))) (t (make-list 3 (* (- 1 beacon-color) 65535)))))) - (apply #'seq-mapn (lambda (r g b) (format "#%04x%04x%04x" r g b)) - (mapcar (lambda (n) (butlast (beacon--int-range (elt fg n) (elt bg n)))) - [0 1 2])))) + (when bg + (apply #'seq-mapn (lambda (r g b) (format "#%04x%04x%04x" r g b)) + (mapcar (lambda (n) (butlast (beacon--int-range (elt fg n) (elt bg n)))) + [0 1 2]))))) ;;; Blinking