GNU bug report logs - #64696
30.0.50; indent-to inherits preceding text properties, including 'invisible

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Tue, 18 Jul 2023 07:59:01 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 64696 <at> debbugs.gnu.org
Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible
Date: Fri, 28 Jul 2023 08:30:47 +0000
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Presumably you'll also want to keep columns aligned dynamically as text
> is inserted/deleted.  I suspect that once you try to do that, it's
> fairly easy to temporarily let-bind `buffer-invisibility-spec` around
> the code that inserts SPCs&TABs to enforce the "vanilla" alignment.

Sure. Org is slowly moving in that direction - separating text alignment
and visual alignment. We have a persistent stream of related feature
requests.

However, remember that this thread started with `indent-to' calculating
target column without taking into account the display staff. While the
initial column is using `current-column' and considers
composition/faces/[partially] invisibility, the number of tabs/spaces to
be inserted to reach target column are calculated assuming that each
space occupies 1 column and each tab occupies tab-width columns.

Now, when we established that Emacs indentation is visual, it is clear
that the assumption in `indent-to' is not accurate.

>> Sure, but how can an application, say, disable all the effects of visual
>> representation without (1) searching and let-binding each specific
>
> Define "disable all the effects of visual representation".  I think what
> you mean is something like "pretend the text is displayed by sending it
> to an text terminal", but the width can depend on the specific text
> terminal (especially for non-ASCII Unicode chars, but also for chars <
> 32).  So it's a non-trivial problem, in reality.

You are right. Probably, a good goal would be "looks aligned in
fundamental-mode".

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 2 years and 50 days ago.

Previous Next


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