branch: externals/do-at-point commit 9f59dd6520f4417bd50efe32f4f35ecfc6bbea17 Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Improve navigation when not on a thing --- do-at-point.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/do-at-point.el b/do-at-point.el index ae6a5e4623..4911af81e9 100644 --- a/do-at-point.el +++ b/do-at-point.el @@ -328,18 +328,18 @@ instead." "Move focus N things ahead. By default, this will move one thing ahead." (interactive "p") - (when (and do-at-point--overlay - (overlay-end do-at-point--overlay)) - (goto-char (overlay-end do-at-point--overlay)) + (when do-at-point--overlay + (when (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") - (when (and do-at-point--overlay - (overlay-start do-at-point--overlay)) - (goto-char (overlay-start do-at-point--overlay)) + (when do-at-point--overlay + (when (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)))))