From: Eli Zaretskii <eliz@gnu.org>
To: Christoph Arenz <tiga.arenz@web.de>
Cc: 43587@debbugs.gnu.org
Subject: bug#43587: move-to-column behaves differently when text has invisible property
Date: Tue, 29 Sep 2020 22:00:24 +0300 [thread overview]
Message-ID: <83blhojtmf.fsf@gnu.org> (raw)
In-Reply-To: <c45bfd09-1574-49c8-ad04-5e5f0bcdd1da@web.de> (message from Christoph Arenz on Tue, 29 Sep 2020 17:56:45 +0200)
> From: Christoph Arenz <tiga.arenz@web.de>
> Date: Tue, 29 Sep 2020 17:56:45 +0200
>
> (progn
> (switch-to-buffer "indent-test.txt")
> (erase-buffer)
> (insert "\tLine starting with INVISIBLE text after TAB\n")
> (insert "\tLine starting with visible text after TAB\n")
> (insert "\nUsing move-to-column to move 'into' TAB, using the FORCE parameter on both lines\n")
> (whitespace-mode 1)
> (add-text-properties 2 21 '(invisible t))
> (beginning-of-buffer)
> (move-to-column 7 t)
> (forward-line)
> (move-to-column 7 t))
It's a deficiency in the algorithm used by move-to-column that
determines whether the goal column is in the middle of a TAB. It
assumes that in such a case the TAB is the previous character that
ends at the column where the movement ended, but that is not so when
invisible text immediately follows the TAB, because moving over the
TAB will in that case also skip all of the following invisible text.
I will see how this can be fixed without making the function too slow
(because it needs to consider overlays as well, not just text
properties).
next prev parent reply other threads:[~2020-09-29 19:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 10:23 bug#43587: 27.1; Org is breaking links Christoph Arenz
2020-09-29 15:56 ` bug#43587: move-to-column behaves differently when text has invisible property Christoph Arenz
2020-09-29 16:22 ` Eli Zaretskii
[not found] ` <f6f19f79-702b-9e98-b297-234a7b2d9f20@web.de>
2020-09-29 16:50 ` Eli Zaretskii
2020-09-29 19:00 ` Eli Zaretskii [this message]
2020-09-30 14:35 ` Eli Zaretskii
2020-10-06 16:01 ` Christoph Arenz
2020-10-06 16:11 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83blhojtmf.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=43587@debbugs.gnu.org \
--cc=tiga.arenz@web.de \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.