From: Eli Zaretskii Date: Sat, 6 Jul 2013 17:38:24 +0000 (+0300) Subject: Fix vertical cursor motion with non-default fonts. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1904 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=23de972aa74fce7360b263d639ffbd674931e408;p=emacs.git Fix vertical cursor motion with non-default fonts. lisp/simple.el (line-move-partial): Adjust the row returned by posn-at-point for the current window-vscroll. (Bug#14567) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 872f4f56677..a4ee883f518 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-07-06 Eli Zaretskii + + * simple.el (line-move-partial): Adjust the row returned by + posn-at-point for the current window-vscroll. (Bug#14567) + 2013-07-06 Michael Albinus * net/tramp-sh.el (tramp-sh-file-gvfs-monitor-dir-process-filter): diff --git a/lisp/simple.el b/lisp/simple.el index c4c7d56dc2a..b4b8ddfabed 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4759,9 +4759,12 @@ lines." this-height (nth 4 wstart)))) (setq py (or (nth 1 this-lh) - (let ((ppos (posn-at-point))) - (cdr (or (posn-actual-col-row ppos) - (posn-col-row ppos)))))) + (let ((ppos (posn-at-point)) + col-row) + (setq col-row (posn-actual-col-row ppos)) + (if col-row + (- (cdr col-row) (window-vscroll)) + (cdr (posn-col-row ppos)))))) (cond ;; If last line of window is fully visible, and vscrolling ;; more would make this line invisible, move forward.