emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 4ef0fc1: Fix 'next-line' and 'previous-line' during


From: Eli Zaretskii
Subject: [Emacs-diffs] master 4ef0fc1: Fix 'next-line' and 'previous-line' during keyboard macro
Date: Sat, 28 May 2016 15:35:17 +0000 (UTC)

branch: master
commit 4ef0fc192b8a10625053dbb9376c814e68612eb6
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix 'next-line' and 'previous-line' during keyboard macro
    
    * lisp/simple.el (line-move-visual): Handle the case when point
    moves outside of the visible portion of the buffer while executing
    a keyboard macro.  (Bug#13452)  (Bug#23551)  (Bug#23555)
---
 lisp/simple.el |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index affc403..3d25ec1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6054,7 +6054,13 @@ If NOERROR, don't signal an error if we can't move that 
many lines."
          (setq temporary-goal-column
                (cons (/ (float x-pos)
                         (frame-char-width))
-                      hscroll))))))
+                      hscroll)))
+        (executing-kbd-macro
+         ;; When we move beyond the first/last character visible in
+         ;; the window, posn-at-point will return nil, so we need to
+         ;; approximate the goal column as below.
+         (setq temporary-goal-column
+               (mod (current-column) (window-text-width)))))))
     (if target-hscroll
        (set-window-hscroll (selected-window) target-hscroll))
     ;; vertical-motion can move more than it was asked to if it moves



reply via email to

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