[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#53795: 27.2; unexpected column change while kbd-macro
From: |
Eli Zaretskii |
Subject: |
bug#53795: 27.2; unexpected column change while kbd-macro |
Date: |
Sat, 05 Feb 2022 13:06:21 +0200 |
> From: awrhygty@outlook.com
> Date: Sat, 05 Feb 2022 18:40:46 +0900
>
> Evaluate the form below, I expect all lines look like "abc".
> But some of the lines look like "cycaby".
>
> (let ((buf (generate-new-buffer "tmp")))
> (switch-to-buffer buf)
> (dotimes (i 100)
> (insert (propertize "x" 'display "ab") "y\n"))
> (goto-char (point-min))
> (end-of-line)
> (execute-kbd-macro "\C-b\C-dc\C-n" 100))
That's because current-column returned an incorrect value when display
strings are used. In the "tmp" buffer, go to the first line, move
cursor to the 'y' character, and type "C-x =" -- you will see that
Emacs thinks this is column 1, not 2.
I've now fixed current-column in this case (on the master branch), so
the above snippet now behaves as expected.