emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 010e64b 3/4: [Fix #15] Only blink if the window *really* s


From: Artur Malabarba
Subject: [elpa] master 010e64b 3/4: [Fix #15] Only blink if the window *really* scrolled
Date: Sun, 25 Oct 2015 15:30:28 +0000

branch: master
commit 010e64bef8a9ec5539733ff0c2e92d075b25a271
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    [Fix #15] Only blink if the window *really* scrolled
---
 beacon.el |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/beacon.el b/beacon.el
index d56e094..6433ba0 100644
--- a/beacon.el
+++ b/beacon.el
@@ -5,7 +5,7 @@
 ;; Author: Artur Malabarba <address@hidden>
 ;; URL: https://github.com/Malabarba/beacon
 ;; Keywords: convenience
-;; Version: 0.2.1
+;; Version: 0.3
 ;; Package-Requires: ((seq "1.9"))
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -336,7 +336,7 @@ If DELTA is nil, return nil."
   (beacon--maybe-push-mark)
   (setq beacon--window-scrolled nil))
 
-(defun beacon--window-scroll-function (win _start-pos)
+(defun beacon--window-scroll-function (win start-pos)
   "Blink the beacon or record that window has been scrolled.
 If invoked during the command loop, record the current window so
 that it may be blinked on post-command.  This is because the
@@ -345,10 +345,12 @@ scrolled window might not be active, but we only know 
that at
 
 If invoked outside the command loop, `post-command-hook' would be
 unreliable, so just blink immediately."
-  (if this-command
-      (setq beacon--window-scrolled win)
-    (setq beacon--window-scrolled nil)
-    (beacon-blink)))
+  (unless (and (equal beacon--previous-window-start start-pos)
+               (equal beacon--previous-window win))
+    (if this-command
+        (setq beacon--window-scrolled win)
+      (setq beacon--window-scrolled nil)
+      (beacon-blink))))
 
 (defun beacon--blink-on-focus ()
   "Blink if `beacon-blink-when-focused' is non-nil"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]