]> git.earman.xyz Git - emacsinit.git/commitdiff
Only visual movements when visual-line-mode is active
authorrearman <rearman@r717.net>
Tue, 17 Mar 2026 15:28:52 +0000 (11:28 -0400)
committerrearman <rearman@r717.net>
Tue, 17 Mar 2026 15:28:52 +0000 (11:28 -0400)
re/re-editing-defuns.el

index 4a7098502a006d420cce7c01776fbac55494ba1e..b045bb612920ed42a15cb1beda37044b84ae8ef0 100644 (file)
@@ -73,7 +73,7 @@ If in org-mode, call `org-beginning-of-line' first."
     (if (equal major-mode 'org-mode)
        (org-beginning-of-line)
       (progn
-       (beginning-of-visual-line 1)
+       (when visual-line-mode (beginning-of-visual-line 1))
        (skip-syntax-forward " " (line-end-position))
        (backward-prefix-chars)))
     (and (= oldpos (point))
@@ -89,7 +89,8 @@ If in org-mode, call `org-end-of-line' first."
   (let ((oldpos (point)))
     (if (equal major-mode 'org-mode)
        (org-end-of-line)
-      (end-of-visual-line 1))
+      (when visual-line-mode
+       (end-of-visual-line 1)))
     (and (= oldpos (point)) (move-end-of-line nil))))
 
 (defun re/goto-line ()