emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]