[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0bdebed 29/34: Blink only in selected window; blink when s
From: |
Artur Malabarba |
Subject: |
[elpa] master 0bdebed 29/34: Blink only in selected window; blink when switching windows |
Date: |
Fri, 16 Oct 2015 09:56:59 +0000 |
branch: master
commit 0bdebedefd366bae9164b896a53f3e4001297998
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Blink only in selected window; blink when switching windows
---
beacon.el | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/beacon.el b/beacon.el
index b6aa776..d9f2396 100644
--- a/beacon.el
+++ b/beacon.el
@@ -45,6 +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-point-moves'.
;;
@@ -89,6 +90,10 @@ movement distance (in lines) that triggers a beacon blink."
"Should the beacon blink when the window scrolls?"
:type 'boolean)
+(defcustom beacon-blink-when-window-changes t
+ "Should the beacon blink when the window changes?"
+ :type 'boolean)
+
(defcustom beacon-blink-duration 0.3
"Time, in seconds, that the blink should last."
:type 'number)
@@ -144,6 +149,7 @@ blink."
;; Our overlay is very temporary, so we take the liberty of giving
;; it a high priority.
(overlay-put ov 'priority beacon-overlay-priority)
+ (overlay-put ov 'window (selected-window))
(while properties
(overlay-put ov (pop properties) (pop properties)))
(push ov beacon--ovs)
@@ -266,6 +272,7 @@ Only returns `beacon-size' elements."
(defvar beacon--window-scrolled nil)
(defvar beacon--previous-place nil)
(defvar beacon--previous-mark-head nil)
+(defvar beacon--previous-window nil)
(defun beacon--movement-> (delta)
"Return non-nil if latest point movement is > DELTA.
@@ -294,6 +301,10 @@ If DELTA is nil, return nil."
(cond
((not (markerp beacon--previous-place))
(beacon--vanish))
+ ;; Blink for switching windows.
+ ((and beacon-blink-when-window-changes
+ (not (eq beacon--previous-window (selected-window))))
+ (beacon-blink))
;; Blink for scrolling.
((and beacon-blink-when-window-scrolls
beacon--window-scrolled
@@ -308,7 +319,8 @@ If DELTA is nil, return nil."
(setq beacon--window-scrolled nil)
(unless (window-minibuffer-p)
(setq beacon--previous-mark-head (car mark-ring))
- (setq beacon--previous-place (point-marker))))
+ (setq beacon--previous-place (point-marker))
+ (setq beacon--previous-window (selected-window))))
(defun beacon--window-scroll-function (win _start-pos)
"Blink the beacon or record that window has been scrolled.
- [elpa] master 0036355 23/34: Copyright, (continued)
- [elpa] master 0036355 23/34: Copyright, Artur Malabarba, 2015/10/16
- [elpa] master bccd3de 33/34: Document contributors, Artur Malabarba, 2015/10/16
- [elpa] master d1f0728 26/34: Extend doc, Artur Malabarba, 2015/10/16
- [elpa] master 4a7079e 17/34: Improve readme, Artur Malabarba, 2015/10/16
- [elpa] master f439a41 27/34: Fix double blink when switching buffer, Artur Malabarba, 2015/10/16
- [elpa] master d66b206 28/34: Refactor overlay creation, Artur Malabarba, 2015/10/16
- [elpa] master b033c63 30/34: Merge pull request #6 from tsdh/master, Artur Malabarba, 2015/10/16
- [elpa] master 7294729 24/34: Don't blink on the minibuffer, Artur Malabarba, 2015/10/16
- [elpa] master 3e1defb 32/34: Don't blink in magit status buffers, Artur Malabarba, 2015/10/16
- [elpa] master d48f296 31/34: Doc, Artur Malabarba, 2015/10/16
- [elpa] master 0bdebed 29/34: Blink only in selected window; blink when switching windows,
Artur Malabarba <=
- [elpa] master 441ebfe 19/34: Indentation, Artur Malabarba, 2015/10/16
- [elpa] master 849bc39 18/34: Rely on window-scroll-functions for scroll blinks, Artur Malabarba, 2015/10/16
- [elpa] master 2eb4c54 34/34: Add 'packages/beacon/' from commit 'bccd3de53787c996f9a90bcb5d541252deda01e1', Artur Malabarba, 2015/10/16