unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: awrhygty@outlook.com
Cc: 53795-done@debbugs.gnu.org
Subject: bug#53795: 27.2; unexpected column change while kbd-macro
Date: Sat, 05 Feb 2022 13:06:21 +0200	[thread overview]
Message-ID: <83mtj51sk2.fsf@gnu.org> (raw)
In-Reply-To: <TYZPR01MB39200703AC7DCDA1DA5DA365C32A9@TYZPR01MB3920.apcprd01.prod.exchangelabs.com> (awrhygty@outlook.com)

> 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.





      reply	other threads:[~2022-02-05 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-05  9:40 bug#53795: 27.2; unexpected column change while kbd-macro awrhygty
2022-02-05 11:06 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtj51sk2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=53795-done@debbugs.gnu.org \
    --cc=awrhygty@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).