Subject: bug#23570: 25.1.50; Cursor motion error with visual-line-mode

From: Chong Yidong <[email-masked]>
Date: Thu, 19 May 2016 10:58:42 +0800

Eli Zaretskii <[email-masked]> writes:

> I cannot say I can reproduce this on my machine.  I see something
> similar in Emacs 24.5, but not with the current master or release
> branch.
>
> I think what you see could be explained by changing the frame size by
> non-integer number of characters (i.e. by a number of pixels that is
> smaller than the canonical character width).  But since I cannot come
> up with a reproducible recipe, I cannot debug this.

The recipe does not describe changing the frame size by non-integer
number of characters.  I'm changing the frame (hence window) size by
dragging the frame border; the width changes by one character at a time.

To remove all ambiguity, here is another recipe using elisp:

1. emacs -Q

2. Insert the following:

(defun foo ()
  (interactive)
  (save-excursion
    (dotimes (x 7)
      (insert "123456789 "))
    (insert "12 ABCDEFGHIJK  MOPQ"))
  (visual-line-mode)
  (set-frame-parameter nil 'width 85))

3. M-x eval-buffer RET

4. M-x foo RET

5. C-e  => cursor goes to the wrong place.