]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix double blink when switching buffer
authorArtur Malabarba <bruce.connor.am@gmail.com>
Thu, 15 Oct 2015 23:05:29 +0000 (00:05 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Thu, 15 Oct 2015 23:05:29 +0000 (00:05 +0100)
beacon.el

index 0b1ae0a1c023774603fe270738ce65671660e2d5..d7be5a6258a591e4d461323489f5c01ecac5c148 100644 (file)
--- a/beacon.el
+++ b/beacon.el
@@ -288,23 +288,18 @@ If DELTA is nil, return nil."
   (cond
    ((not (markerp beacon--previous-place))
     (beacon--vanish))
-   ;; Blink because we changed buffer.
-   ((not (equal (marker-buffer beacon--previous-place)
-                (current-buffer)))
-    (when beacon-blink-when-buffer-changes
-      (beacon-blink)))
    ;; Blink for scrolling.
    ((and beacon-blink-when-window-scrolls
          beacon--window-scrolled
          (equal beacon--window-scrolled (selected-window)))
-    (beacon-blink)
-    (setq beacon--window-scrolled nil))
+    (beacon-blink))
    ;; Blink for movement
    ((beacon--movement-> beacon-blink-when-point-moves)
     (beacon-blink))
    ;; Even if we don't blink, vanish any previous beacon.
    (t (beacon--vanish)))
   (beacon--maybe-push-mark)
+  (setq beacon--window-scrolled nil)
   (unless (window-minibuffer-p)
     (setq beacon--previous-mark-head (car mark-ring))
     (setq beacon--previous-place (point-marker))))
@@ -320,6 +315,7 @@ 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)))
 
 \f