From: Ihor Radchenko <yantar92@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, 64696@debbugs.gnu.org
Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible
Date: Thu, 27 Jul 2023 08:58:54 +0000 [thread overview]
Message-ID: <87fs597msx.fsf@localhost> (raw)
In-Reply-To: <83zg3kp3of.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> In the ideal world, Emacs would indent both visually and textually.
>
> I disagree that this is the ideal. "Textual" indentation is not
> indentation at all, it is fundamentally a completely different feature
> for completely different purposes. Even if we agree that Emacs should
> have it (and I don't yet agree), you shouldn't expect from the Emacs
> indentation to fill this niche, except by sheer luck in some use
> cases.
Got it.
>> With visual part only using 'display text properties that do not
>> modify the actual text in file.
>
> This will (a) not help you, because the issue of width of the
> whitespace stretches will still be pertinent; and (b) will complicate
> Emacs much more, because copying such "text" will become much more
> tricky in general.
I am not sure if I understand the problem with copying. Certain text
properties are already ignored when copying anyway.
> But if you want to work on adding this, please feel free. It has its
> uses, even for indentation; see, for example, pixel-fill.el. It is on
> our TODO to provide pixel-granularity indentation for text using
> variable-pitch fonts (but this again is for visual appearance only).
I did some preliminary work in Org mode.
For example, I tried to right-align tags like
|left fringe|* Heading :tag:|right fringe|
Using :align-to space spec and font-lock-keywords.
This can work, although it is unfortunate that there is no "stretch"
space that will automatically occupy as much space as possible without
pushing the line across right fringe.
Org also provides org-indent-mode that uses text properties to align
text visually.
>> I would use it in Org instead of `org-current-text-column'.
>
> So we have one user. And even in your case, you don't want them all
> disabled: the character compositions, for example, should stay turned
> ON.
Sure. Especially if the composition is dictated by UTF standard.
>> may not hold in future (the docstring implies that `string-width' may as
>> well consider visuals: "Return width of STRING when displayed in the
>> current buffer.")
>
> Selective citation alert! The full text of the doc string is:
>
> Return width of STRING when displayed in the current buffer.
> Width is measured by how many columns it occupies on the screen.
> Optional arguments FROM and TO specify the substring of STRING to
> consider, and are interpreted as in ‘substring’.
>
> When calculating width of a multibyte character in STRING,
> only the base leading-code is considered; the validity of
> the following bytes is not checked. Tabs in STRING are always
> taken to occupy ‘tab-width’ columns. The effect of faces and fonts
> used for non-Latin and other unusual characters (such as emoji) is
> ignored as well, as are display properties and invisible text.
> For these reasons, the results are not generally reliable;
> for accurate dimensions of text as it will be displayed,
> use ‘window-text-pixel-size’ instead.
>
> What else do you want us to say, for you to understand that the
> "visual" part here is quite limited?
It is clear that it is limited, but I am concerned that there are still
some display features (and possibly display features added in future)
that may change the behavior.
I think that the main source of the confusion is the first line "Return
width of STRING when displayed in the current buffer", which sounds like
certain buffer-specific display things are affecting the result.
--
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>
next prev parent reply other threads:[~2023-07-27 8:58 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 7:58 bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible Ihor Radchenko
2023-07-18 11:23 ` Eli Zaretskii
2023-07-18 12:09 ` Ihor Radchenko
2023-07-18 13:10 ` Eli Zaretskii
2023-07-18 13:25 ` Ihor Radchenko
2023-07-18 16:13 ` Eli Zaretskii
2023-07-18 16:25 ` Ihor Radchenko
2023-07-18 17:08 ` Eli Zaretskii
2023-07-19 8:30 ` Ihor Radchenko
2023-07-19 13:07 ` Eli Zaretskii
2023-07-20 9:10 ` Ihor Radchenko
2023-07-21 8:32 ` Ihor Radchenko
2023-07-22 6:51 ` Eli Zaretskii
2023-07-22 7:09 ` Ihor Radchenko
2023-07-22 11:35 ` Eli Zaretskii
2023-07-22 14:10 ` Ihor Radchenko
2023-07-22 14:31 ` Eli Zaretskii
2023-07-22 6:49 ` Eli Zaretskii
2023-07-22 7:03 ` Ihor Radchenko
2023-07-22 11:22 ` Eli Zaretskii
2023-07-22 14:05 ` Ihor Radchenko
2023-07-22 14:28 ` Eli Zaretskii
2023-07-23 7:30 ` Ihor Radchenko
2023-07-23 10:05 ` Eli Zaretskii
2023-07-24 8:18 ` Ihor Radchenko
2023-07-24 13:09 ` Eli Zaretskii
2023-07-25 8:38 ` Ihor Radchenko
2023-07-25 12:37 ` Eli Zaretskii
2023-07-27 8:58 ` Ihor Radchenko [this message]
2023-07-27 9:15 ` Eli Zaretskii
2023-07-28 8:06 ` Ihor Radchenko
2023-07-28 11:52 ` Eli Zaretskii
2023-07-29 9:00 ` Ihor Radchenko
2023-07-29 10:33 ` Eli Zaretskii
2023-07-30 7:51 ` Ihor Radchenko
2023-07-30 9:59 ` Eli Zaretskii
2023-07-30 11:45 ` Ihor Radchenko
2023-07-30 17:11 ` Eli Zaretskii
2023-07-31 7:18 ` Ihor Radchenko
2023-07-31 11:49 ` Eli Zaretskii
2023-07-28 2:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-28 8:30 ` Ihor Radchenko
2023-07-28 12:06 ` Eli Zaretskii
2023-07-28 12:26 ` Ihor Radchenko
2023-07-28 12:48 ` Eli Zaretskii
2023-07-28 13:02 ` Ihor Radchenko
2023-07-28 14:17 ` Eli Zaretskii
2023-07-29 9:06 ` Ihor Radchenko
2023-07-22 13:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 14:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 16:20 ` Eli Zaretskii
2023-07-18 19:33 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-19 8:42 ` Ihor Radchenko
2023-07-19 13:10 ` Eli Zaretskii
2023-07-19 14:25 ` Ihor Radchenko
2023-07-19 15:09 ` Eli Zaretskii
2023-07-19 8:41 ` Ihor Radchenko
2023-07-19 13:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=87fs597msx.fsf@localhost \
--to=yantar92@posteo.net \
--cc=64696@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).