[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scroll-on-drag 64445dd96f 15/35: Apply auto-formatting
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scroll-on-drag 64445dd96f 15/35: Apply auto-formatting |
Date: |
Thu, 7 Jul 2022 12:02:50 -0400 (EDT) |
branch: elpa/scroll-on-drag
commit 64445dd96faf911ede7d974338bb1ba8aa731cae
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Apply auto-formatting
---
scroll-on-drag.el | 53 +++++++++++++++++++++++++++++++++--------------------
1 file changed, 33 insertions(+), 20 deletions(-)
diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index f8ae3ba9fe..c9951d3dc3 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -44,22 +44,22 @@
(defcustom scroll-on-drag-delay 0.01
"Idle time between scroll updates."
:group 'scroll-on-drag
- :type 'float)
+ :type 'float)
(defcustom scroll-on-drag-motion-scale 0.25
"Scroll speed multiplier."
:group 'scroll-on-drag
- :type 'float)
+ :type 'float)
(defcustom scroll-on-drag-motion-accelerate 0.3
"Non-linear scroll power (0.0 for linear speed, 1.0 for very fast
acceleration)."
:group 'scroll-on-drag
- :type 'float)
+ :type 'float)
(defcustom scroll-on-drag-smooth t
"Use smooth (pixel) scrolling."
:group 'scroll-on-drag
- :type 'boolean)
+ :type 'boolean)
(defcustom scroll-on-drag-pre-hook nil
"List of functions to be called when scroll-on-drag starts."
@@ -126,7 +126,8 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
(scroll-px (- scroll-px-next (* lines char-height)))
(lines-remainder 0))
(unless (zerop lines)
- (setq lines-remainder (- (scroll-on-drag--scroll-by-lines window (-
lines) also-move-point))) ;; flip
+ (setq lines-remainder
+ (- (scroll-on-drag--scroll-by-lines window (- lines)
also-move-point))) ;; flip
(unless (zerop lines-remainder)
(setq scroll-px char-height)))
(set-window-vscroll window (- char-height scroll-px) t)
@@ -146,7 +147,8 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
(set-window-vscroll window scroll-px t)
lines-remainder))
;; no lines scrolled.
- (t 0)))
+ (t
+ 0)))
;; End generic scrolling functions.
@@ -189,7 +191,12 @@ Returns true when scrolling took place, otherwise nil."
(restore-x-pointer-shape (and (boundp 'x-pointer-shape) x-pointer-shape))
;; Restore indent (lost when scrolling).
- (restore-indent (- (point) (save-excursion (back-to-indentation)
(point))))
+ (restore-indent
+ (-
+ (point)
+ (save-excursion
+ (back-to-indentation)
+ (point))))
(mouse-y-fn
(cond
@@ -254,8 +261,7 @@ Returns true when scrolling took place, otherwise nil."
(lambda (self-fn)
(let ((lines delta))
(unless (zerop lines)
- (setq delta-px-accum
- (- delta-px-accum (* lines this-frame-char-height)))
+ (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))
@@ -292,8 +298,7 @@ Returns true when scrolling took place, otherwise nil."
(let ((lines (/ delta-px-accum this-frame-char-height)))
(unless (zerop lines)
- (setq delta-px-accum
- (- delta-px-accum (* lines this-frame-char-height)))
+ (setq delta-px-accum (- delta-px-accum (* lines
this-frame-char-height)))
(scroll-on-drag--scroll-by-lines this-window lines t)
(setq do-draw t)))))
@@ -323,9 +328,7 @@ Returns true when scrolling took place, otherwise nil."
(setq y-init (funcall mouse-y-fn))))
(scroll-restore-fn
- (lambda ()
- (goto-char restore-point)
- (set-window-start this-window restore-window-start t)))
+ (lambda () (goto-char restore-point) (set-window-start this-window
restore-window-start t)))
;; Workaround for bad pixel scrolling performance
;; when the cursor is partially outside the view.
@@ -336,11 +339,12 @@ Returns true when scrolling took place, otherwise nil."
(lines-from-top
(count-lines
(window-start)
- (save-excursion (move-beginning-of-line nil) (point)))))
+ (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))
+ (let ((inhibit-redisplay nil))
(run-hooks 'scroll-on-drag-redisplay-hook)
(redisplay)))))))
@@ -391,7 +395,8 @@ Returns true when scrolling took place, otherwise nil."
(setq delta-prev delta)
t)
;; Cancel...
- (t nil)))))
+ (t
+ nil)))))
(funcall scroll-snap-smooth-to-line-fn)
(funcall timer-stop-fn)
@@ -407,7 +412,11 @@ Returns true when scrolling took place, otherwise nil."
(right-char
(min
restore-indent
- (- (save-excursion (move-end-of-line nil) (point)) (point)))))
+ (-
+ (save-excursion
+ (move-end-of-line nil)
+ (point))
+ (point)))))
;; Restore pointer.
(when (boundp 'x-pointer-shape)
@@ -426,7 +435,11 @@ Returns true when scrolling took place, otherwise nil."
(defmacro scroll-on-drag-with-fallback (&rest body)
"A macro to scroll and perform a different action on click.
Optional argument BODY Hello."
- `(lambda () (interactive) (unless (scroll-on-drag) ,@body)))
+ `
+ (lambda ()
+ (interactive)
+ (unless (scroll-on-drag)
+ ,@body)))
(provide 'scroll-on-drag)
- [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, 2022/07/07
- [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 <=
- [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
- [nongnu] elpa/scroll-on-drag 81623ccc59 10/35: Add pre/post hooks, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag fb9af98461 34/35: Change URL to codeberg, ELPA Syncer, 2022/07/07