summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorK. Handa <handa@gnu.org>2016-06-01 08:07:18 +0900
committerK. Handa <handa@gnu.org>2016-06-01 08:07:18 +0900
commit4efef3db2fb1c3a20b83a67948e614d9b0c258dd (patch)
treec0c08fc308869f7ba3d988594e4a51b69a70325b /lisp/simple.el
parent694d5e5b56a9d55023ffc292188bd88f6f6cbca6 (diff)
parent01030eed9395f5004e7d0721394697d1ca90cc2f (diff)
downloademacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.tar.gz
emacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.tar.bz2
emacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index affc403dcdc..3d25ec19ab2 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