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

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

[nongnu] elpa/hl-block-mode 295ad0cdcd: Correct compatibility for pos-bo


From: ELPA Syncer
Subject: [nongnu] elpa/hl-block-mode 295ad0cdcd: Correct compatibility for pos-bol/eol for emacs <29.1
Date: Sun, 15 Jan 2023 01:59:44 -0500 (EST)

branch: elpa/hl-block-mode
commit 295ad0cdcdfeef90ec7dbee2fde0f78fdcb437ef
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

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

diff --git a/hl-block-mode.el b/hl-block-mode.el
index 1aa5c0fa2c..d76a668f67 100644
--- a/hl-block-mode.el
+++ b/hl-block-mode.el
@@ -28,13 +28,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]