GNU bug report logs - #53795
27.2; unexpected column change while kbd-macro

Previous Next

Package: emacs;

Reported by: awrhygty <at> outlook.com

Date: Sat, 5 Feb 2022 10:02:02 UTC

Severity: normal

Found in version 27.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 53795-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: awrhygty <at> outlook.com
Cc: 53795-done <at> debbugs.gnu.org
Subject: Re: bug#53795: 27.2; unexpected column change while kbd-macro
Date: Sat, 05 Feb 2022 13:06:21 +0200
> From: awrhygty <at> 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.




This bug report was last modified 3 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.