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

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

[nongnu] elpa/scroll-on-drag b5ed8d35b1: Correct compatibility for pos-b


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-drag b5ed8d35b1: Correct compatibility for pos-bol/eol for emacs <29.1
Date: Sun, 15 Jan 2023 02:00:38 -0500 (EST)

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

    Correct compatibility for pos-bol/eol for emacs <29.1
---
 scroll-on-drag.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index fdde96ddf9..307ef2bb8c 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -24,13 +24,17 @@
 ;; ---------------------------------------------------------------------------
 ;; Compatibility
 
-(when (version< emacs-version "29.1")
-  (defsubst pos-bol (&optional n)
+(when (and (version< emacs-version "29.1") (not (and (fboundp 'pos-bol) 
(fboundp 'pos-eol))))
+  (defun pos-bol (&optional n)
     "Return the position at the line beginning."
-    (line-beginning-position n))
-  (defsubst pos-eol (&optional n)
+    (declare (side-effect-free t))
+    (let ((inhibit-field-text-motion t))
+      (line-beginning-position n)))
+  (defun pos-eol (&optional n)
     "Return the position at the line end."
-    (line-end-position n)))
+    (declare (side-effect-free t))
+    (let ((inhibit-field-text-motion t))
+      (line-end-position n))))
 
 
 ;; ---------------------------------------------------------------------------



reply via email to

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