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

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

[elpa] externals/do-at-point acb156f090: Ensure do-at-point-{forward, ba


From: ELPA Syncer
Subject: [elpa] externals/do-at-point acb156f090: Ensure do-at-point-{forward, backward} always moves
Date: Mon, 28 Aug 2023 03:57:42 -0400 (EDT)

branch: externals/do-at-point
commit acb156f090724d4d773efb97d3ef8031c4a35c3e
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Ensure do-at-point-{forward,backward} always moves
---
 do-at-point.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/do-at-point.el b/do-at-point.el
index 909bdc139a..25bad6f61e 100644
--- a/do-at-point.el
+++ b/do-at-point.el
@@ -326,13 +326,20 @@ instead."
   "Move focus N things ahead.
 By default, this will move one thing ahead."
   (interactive "p")
-  (forward-thing (overlay-get do-at-point--overlay 'do-at-point-thing) n))
+  (when (and do-at-point--overlay
+             (overlay-end do-at-point--overlay))
+    (goto-char (overlay-end do-at-point--overlay))
+    (forward-thing (overlay-get do-at-point--overlay 'do-at-point-thing) n)))
 
 (defun do-at-point-backward (n)
   "Move focus N things back.
 Refer to the command `do-at-point-forward' for more details."
   (interactive "p")
-  (do-at-point-forward (- (or n 1))))
+  (when (and do-at-point--overlay
+             (overlay-start do-at-point--overlay))
+    (goto-char (overlay-start do-at-point--overlay))
+    (forward-thing (overlay-get do-at-point--overlay 'do-at-point-thing)
+                   (- (or n 1)))))
 
 ;;;###autoload
 (defun do-at-point (&optional thing)



reply via email to

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