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

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

[nongnu] elpa/doc-show-inline c64c9e03d9: Correct compatibility for pos-


From: ELPA Syncer
Subject: [nongnu] elpa/doc-show-inline c64c9e03d9: Correct compatibility for pos-bol/eol for emacs <29.1
Date: Sun, 15 Jan 2023 01:59:07 -0500 (EST)

branch: elpa/doc-show-inline
commit c64c9e03d99662ee5777272c940ead171655ed9e
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

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

diff --git a/doc-show-inline.el b/doc-show-inline.el
index f2ebc7cbf8..ccee4b0dde 100644
--- a/doc-show-inline.el
+++ b/doc-show-inline.el
@@ -45,13 +45,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]