[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8abbedc 05/34: Default to blinking on window scroll instea
From: |
Artur Malabarba |
Subject: |
[elpa] master 8abbedc 05/34: Default to blinking on window scroll instead of point movement |
Date: |
Fri, 16 Oct 2015 09:56:49 +0000 |
branch: master
commit 8abbedcc63e7e3d6efd1c0bbbdfd678b88592d21
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
Default to blinking on window scroll instead of point movement
---
beacon.el | 35 +++++++++++++++++++++++++----------
1 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/beacon.el b/beacon.el
index cf3868b..0628dad 100644
--- a/beacon.el
+++ b/beacon.el
@@ -36,18 +36,25 @@
(defvar beacon--timer nil)
-(defcustom beacon-minimum-distance 15
- "Minimum movement distance in lines to blink the beacon."
- :type 'integer)
-
(defcustom beacon-push-mark nil
"Should the mark be pushed before long movements?"
:type 'boolean)
+(defcustom beacon-blink-when-point-moves nil
+ "Should the beacon blink when changing buffer?
+If nil, don't blink due to plain movement.
+If non-nil, this should be an integer, which is the minimum
+movement distance (in lines) that triggers a beacon blink."
+ :type '(choice integer (const nil)))
+
(defcustom beacon-blink-when-buffer-changes t
"Should the beacon blink when changing buffer?"
:type 'boolean)
+(defcustom beacon-blink-when-window-scrolls t
+ "Should the beacon blink when the window scrolls?"
+ :type 'boolean)
+
(defcustom beacon-blink-duration 0.3
"Time, in seconds, that the blink should last."
:type 'number)
@@ -60,7 +67,7 @@
"Size of the beacon in characters."
:type 'number)
-(defcustom beacon-brightness 0.5
+(defcustom beacon-brightness 0.4
"Brightness as a float between 0 and 1."
:type 'number)
@@ -144,6 +151,7 @@ Only returns `beacon-size' elements."
;;; Movement detection
(defvar beacon--previous-place nil)
+(defvar beacon--previous-window-start nil)
(defvar beacon--previous-mark-head nil)
(defun beacon--maybe-push-mark ()
@@ -166,17 +174,24 @@ Only returns `beacon-size' elements."
(when beacon-blink-when-buffer-changes
(unless (window-minibuffer-p)
(beacon-blink))))
- ;; Blink for distance movement
- ((and (> (abs (- (point) beacon--previous-place))
- beacon-minimum-distance)
+ ;; Blink for scrolling.
+ ((and beacon-blink-when-window-scrolls
+ (progn (redisplay)
+ (not (equal beacon--previous-window-start (window-start)))))
+ (beacon--maybe-push-mark)
+ (beacon-blink))
+ ;; Blink for movement
+ ((and beacon-blink-when-point-moves
+ (> (abs (- (point) beacon--previous-place))
+ beacon-blink-when-point-moves)
(> (count-screen-lines (min (point) beacon--previous-place)
- (max (point) beacon--previous-place))
- beacon-minimum-distance))
+ (max (point) beacon--previous-place))))
(beacon--maybe-push-mark)
(beacon-blink))
;; Even if we don't blink, vanish any previous beacon.
(t (beacon--vanish)))
(unless (window-minibuffer-p)
+ (setq beacon--previous-window-start (window-start))
(setq beacon--previous-mark-head (car mark-ring))
(setq beacon--previous-place (point-marker))))
- [elpa] master updated (6578236 -> 2eb4c54), Artur Malabarba, 2015/10/16
- [elpa] master b509d63 04/34: [Fix #1], Artur Malabarba, 2015/10/16
- [elpa] master 3022997 02/34: Rename to beacon, Artur Malabarba, 2015/10/16
- [elpa] master 36be965 09/34: Make beacon color customizable, Artur Malabarba, 2015/10/16
- [elpa] master 43cbfd4 15/34: Merge pull request #3 from tsdh/master, Artur Malabarba, 2015/10/16
- [elpa] master 8abbedc 05/34: Default to blinking on window scroll instead of point movement,
Artur Malabarba <=
- [elpa] master fbcf9fc 16/34: Drop cl-lib dep, Artur Malabarba, 2015/10/16
- [elpa] master 19096a6 10/34: Initial (failed) impl for beacon at end of line, Artur Malabarba, 2015/10/16
- [elpa] master e533e04 11/34: Fix an error, Artur Malabarba, 2015/10/16
- [elpa] master 03d12b4 03/34: Rename file, Artur Malabarba, 2015/10/16
- [elpa] master 8941740 07/34: Fix docs, Artur Malabarba, 2015/10/16
- [elpa] master c82095a 06/34: Add url, Artur Malabarba, 2015/10/16
- [elpa] master 9152a09 08/34: Separate mark-pushing from blinking, Artur Malabarba, 2015/10/16
- [elpa] master b60416c 01/34: First commit, Artur Malabarba, 2015/10/16
- [elpa] master ca3ec24 14/34: Fix temporary line breaks due to too long after-strings, Artur Malabarba, 2015/10/16
- [elpa] master c507480 13/34: Fix after-string overlays, Artur Malabarba, 2015/10/16