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

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

[nongnu] elpa/spell-fu 10c64b12b2: Correct compatibility for pos-bol/eol


From: ELPA Syncer
Subject: [nongnu] elpa/spell-fu 10c64b12b2: Correct compatibility for pos-bol/eol for emacs <29.1
Date: Sun, 15 Jan 2023 02:00:52 -0500 (EST)

branch: elpa/spell-fu
commit 10c64b12b298856b5aa3c41bfcee375b9b061602
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

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

diff --git a/spell-fu.el b/spell-fu.el
index 6949ba5017..a5175f69a5 100644
--- a/spell-fu.el
+++ b/spell-fu.el
@@ -54,13 +54,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]