[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scroll-on-drag 271b4aa6b3 11/35: Add redisplay hook
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scroll-on-drag 271b4aa6b3 11/35: Add redisplay hook |
Date: |
Thu, 7 Jul 2022 12:02:48 -0400 (EDT) |
branch: elpa/scroll-on-drag
commit 271b4aa6b38c2550119a36efac2b92cf1233e6e3
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Add redisplay hook
Useful for updating other display options which aren't done automatic.
---
scroll-on-drag.el | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index 0ab08d8207..8cf82d4ee8 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -71,6 +71,11 @@
:group 'scroll-on-drag
:type 'hook)
+(defcustom scroll-on-drag-redisplay-hook nil
+ "List of functions to run on scroll redraw."
+ :group 'scroll-on-drag
+ :type 'hook)
+
;; Generic scrolling functions.
;;
@@ -254,7 +259,9 @@ Returns true when scrolling took place, otherwise nil."
(- delta-px-accum (* lines this-frame-char-height)))
(let ((lines-remainder (scroll-on-drag--scroll-by-lines
this-window lines t)))
(unless (zerop (- lines lines-remainder))
- (let ((inhibit-redisplay nil)) (redisplay))))))
+ (let ((inhibit-redisplay nil))
+ (run-hooks 'scroll-on-drag-redisplay-hook)
+ (redisplay))))))
(funcall timer-start-fn self-fn)))
((eq scroll-on-drag-style 'line-by-pixel)
@@ -295,7 +302,10 @@ Returns true when scrolling took place, otherwise nil."
(setq do-draw t))))))
(when do-draw
- (let ((inhibit-redisplay nil)) (redisplay))))
+ (let
+ ((inhibit-redisplay nil))
+ (run-hooks 'scroll-on-drag-redisplay-hook)
+ (redisplay))))
(funcall timer-start-fn self-fn)))))
;; Apply pixel offset and snap to a line.
@@ -306,7 +316,10 @@ Returns true when scrolling took place, otherwise nil."
(scroll-on-drag--scroll-by-lines this-window 1 nil))
(set-window-vscroll this-window 0 t)
(setq delta-px-accum 0)
- (let ((inhibit-redisplay nil)) (redisplay)))))
+ (let
+ ((inhibit-redisplay nil))
+ (run-hooks 'scroll-on-drag-redisplay-hook)
+ (redisplay)))))
(scroll-reset-fn
(lambda ()
@@ -332,7 +345,10 @@ Returns true when scrolling took place, otherwise nil."
(save-excursion (move-beginning-of-line nil) (point)))))
(when (> scroll-margin lines-from-top)
(forward-line (- scroll-margin lines-from-top))
- (let ((inhibit-redisplay nil)) (redisplay))
+ (let
+ ((inhibit-redisplay nil))
+ (run-hooks 'scroll-on-drag-redisplay-hook)
+ (redisplay))
(setq restore-point-use-scroll-offset t))))))
;; Set arrow cursor (avoids annoying flicker on scroll).
@@ -353,7 +369,9 @@ Returns true when scrolling took place, otherwise nil."
(setq has-scrolled nil)
(funcall scroll-reset-fn)
(funcall scroll-restore-fn)
- (let ((inhibit-redisplay nil)) (redisplay))
+ (let ((inhibit-redisplay nil))
+ (run-hooks 'scroll-on-drag-redisplay-hook)
+ (redisplay))
t)
;; Space keeps current position, restarts scrolling.
- [nongnu] elpa/scroll-on-drag 2fbd643ea9 16/35: Add .elisp-autofmt to enable auto-formatting, (continued)
- [nongnu] elpa/scroll-on-drag 2fbd643ea9 16/35: Add .elisp-autofmt to enable auto-formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 01c14f4c02 35/35: Cleanup: quiet checkdoc warning, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 0a362232a0 19/35: Run 'run-window-scroll-functions' after scrolling, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 8962f5f8a7 30/35: Add scroll-on-drag-clamp option to prevent scrolling past point-max, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 2d79a6d9c2 18/35: Cleanup: minor syntax changes, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 97741be699 32/35: Remove override for timer-idle-list, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag f9379c56df 03/35: Call redisplay explicitly, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 56ab51a329 07/35: Use zerop instead of comparing with zero, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 882dc94bb8 12/35: Cleanup: remove unused variables, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag cacadcd9bd 20/35: Cleanup: add sections, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 271b4aa6b3 11/35: Add redisplay hook,
ELPA Syncer <=
- [nongnu] elpa/scroll-on-drag 6d62a239a9 28/35: Cleanup: use defgroup, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 6db1380826 25/35: Cleanup: formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag ba2c1a598e 17/35: Fix for idle timers running during scroll, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 157637ba6b 26/35: Remove cursor setting code (resolving #1), ELPA Syncer, 2022/07/07