all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Herman, Geza" <geza.herman@gmail.com>
Cc: 64988@debbugs.gnu.org
Subject: bug#64988: 30.0.50; move-to-column can move across lines if there is a text with display property
Date: Tue, 01 Aug 2023 16:26:57 +0300	[thread overview]
Message-ID: <83jzue28ri.fsf@gnu.org> (raw)
In-Reply-To: <f3a1359c-170e-36de-9035-e5545f677e7e@gmail.com> (geza.herman@gmail.com)

> Date: Tue, 1 Aug 2023 14:57:29 +0200
> Cc: 64988@debbugs.gnu.org
> From: "Herman, Geza" <geza.herman@gmail.com>
> 
> I think, in my case, the move-to-column should completely ignore the 
> display property. Is there a function which does that?
> 
> I noticed this problem because how indent-bars interacts with 
> column-enforce-mode (https://github.com/jordonbiondo/column-enforce-mode).
> 
> column-enforce-mode uses move-to-column to mark long lines. And because 
> the display property with "\n" basically joins neighboring lines, 
> column-enforce-mode marks lines incorrectly.
> 
> I think it should only consider what's in the buffer, and ignore all 
> rendering related properties. Is there a way to accomplish this?

Copy text into a temporary buffer, remove 'display' properties, call
move-to-column there, then move to the same position in the original
buffer?

> Regarding how to fix this problem: wouldn't it make sense to stop 
> calculating the width at the first "\n" in the displayed string?

Stop calculating and do what?  move-to-column doesn't just calculate,
it should move point to some place.  Where do you want to move point
in these cases?

> At least, it would fix this problem, as far as I understand. Not
> sure if it breaks anything. But supposedly nothing should depend on
> the exact behavior of column calculations, if the displayed string
> contains characters after the first "\n" (because it's kind of
> undefined what the width of a multi-line string is)

When the current line is shorter than N columns, move-to-column with
the argument of N should stop at the end of the line.  But it's
impossible to do that when the newline comes from a display property.
So the correct behavior is not "undefined" in this case, it is just
impossible to achieve.





  reply	other threads:[~2023-08-01 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 10:53 bug#64988: 30.0.50; move-to-column can move across lines if there is a text with display property Herman, Géza
2023-08-01 12:25 ` Eli Zaretskii
2023-08-01 12:57   ` Herman, Geza
2023-08-01 13:26     ` Eli Zaretskii [this message]
2023-08-01 14:32       ` Herman, Geza
2023-09-02 16:38   ` Stefan Kangas

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=83jzue28ri.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64988@debbugs.gnu.org \
    --cc=geza.herman@gmail.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 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.