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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/scroll-on-drag 42d96a60a2 22/35: Cleanup: simplify some lo


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-drag 42d96a60a2 22/35: Cleanup: simplify some logic using 'line-beginning-position'
Date: Thu, 7 Jul 2022 12:02:50 -0400 (EDT)

branch: elpa/scroll-on-drag
commit 42d96a60a207cd73e7a58111358deb05f084c59e
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Cleanup: simplify some logic using 'line-beginning-position'
---
 scroll-on-drag.el | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index cd91918b85..9c483a106a 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -23,7 +23,7 @@
 
 ;;; Commentary:
 
-;; Interactive scrolling which can be cancelled by pressing escape.
+;; Interactive scrolling which can be canceled by pressing escape.
 
 ;;; Usage
 
@@ -217,8 +217,7 @@ Returns true when scrolling took place, otherwise nil."
         (if scroll-on-drag-smooth
           (save-excursion
             (goto-char (point-max))
-            (move-beginning-of-line nil)
-            (point))
+            (line-beginning-position))
           0))
 
       (mouse-y-delta-scale-fn
@@ -339,14 +338,7 @@ Returns true when scrolling took place, otherwise nil."
       ;; when the cursor is partially outside the view.
       (scroll-consrtain-point-below-window-start-fn
         (lambda ()
-          (let
-            (
-              (lines-from-top
-                (count-lines
-                  (window-start)
-                  (save-excursion
-                    (move-beginning-of-line nil)
-                    (point)))))
+          (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))



reply via email to

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