[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scroll-on-drag 31f322554d 31/35: Cleanup: move force-redis
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scroll-on-drag 31f322554d 31/35: Cleanup: move force-redisplay into an inline function |
Date: |
Thu, 7 Jul 2022 12:02:52 -0400 (EDT) |
branch: elpa/scroll-on-drag
commit 31f322554d8bda5028cc4b83a54d77c56bd1d91d
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: move force-redisplay into an inline function
---
scroll-on-drag.el | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index f0b80f9893..c99fe037f6 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -149,6 +149,12 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
;; End generic scrolling functions.
+(defsubst scroll-on-drag--force-redisplay-with-hooks ()
+ "Wrapper for `redisplay' that ignores `inhibit-redisplay'."
+ (let ((inhibit-redisplay nil))
+ (run-hooks 'scroll-on-drag-redisplay-hook)
+ (redisplay)))
+
;; ---------------------------------------------------------------------------
;; Public Functions
@@ -285,9 +291,7 @@ Returns true when scrolling took place, otherwise nil."
(setq delta-px-accum (- 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))
- (run-hooks 'scroll-on-drag-redisplay-hook)
- (redisplay))))))
+ (scroll-on-drag--force-redisplay-with-hooks)))))
(funcall timer-start-fn self-fn)))
((eq scroll-on-drag-style 'line-by-pixel)
@@ -345,9 +349,7 @@ Returns true when scrolling took place, otherwise nil."
(scroll-on-drag--scroll-by-lines this-window (-
lines) t)))))))
(when do-draw
- (let ((inhibit-redisplay nil))
- (run-hooks 'scroll-on-drag-redisplay-hook)
- (redisplay))))
+ (scroll-on-drag--force-redisplay-with-hooks)))
(funcall timer-start-fn self-fn)))))
;; Apply pixel offset and snap to a line.
@@ -358,9 +360,7 @@ 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))
- (run-hooks 'scroll-on-drag-redisplay-hook)
- (redisplay)))))
+ (scroll-on-drag--force-redisplay-with-hooks))))
(scroll-reset-fn
(lambda ()
@@ -381,9 +381,7 @@ Returns true when scrolling took place, otherwise nil."
(let ((lines-from-top (count-lines (window-start)
(line-beginning-position))))
(when (> scroll-margin lines-from-top)
(forward-line (- scroll-margin lines-from-top))
- (let ((inhibit-redisplay nil))
- (run-hooks 'scroll-on-drag-redisplay-hook)
- (redisplay)))))))
+ (scroll-on-drag--force-redisplay-with-hooks))))))
;; ---------------
;; Main Event Loop
@@ -397,9 +395,7 @@ Returns true when scrolling took place, otherwise nil."
(setq has-scrolled nil)
(funcall scroll-reset-fn)
(funcall scroll-restore-fn)
- (let ((inhibit-redisplay nil))
- (run-hooks 'scroll-on-drag-redisplay-hook)
- (redisplay))
+ (scroll-on-drag--force-redisplay-with-hooks)
t)
;; Space keeps current position, restarts scrolling.
- [nongnu] branch elpa/scroll-on-drag created (now 01c14f4c02), ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag f07ea06555 13/35: Cleanup: style, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 42d96a60a2 22/35: Cleanup: simplify some logic using 'line-beginning-position', ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag ad94790492 24/35: readme: link to melpa, tweak title level, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 31f322554d 31/35: Cleanup: move force-redisplay into an inline function,
ELPA Syncer <=
- [nongnu] elpa/scroll-on-drag d93b69eed6 33/35: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 64445dd96f 15/35: Apply auto-formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag a717d58f31 01/35: Add license file, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag a668537a8d 02/35: Initial modal scroll, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 494de949d5 04/35: Restore indent level, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 6cf8c0d81e 06/35: Enable smooth scrolling by default, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 888abd04c3 09/35: Add melpa link, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag d8582732d1 29/35: Scroll the window under the mouse cursor, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 31c3baed1d 08/35: Check x-pointer-shape is available before setting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag fa6a293c74 14/35: Correct macro, ELPA Syncer, 2022/07/07