all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 40856@debbugs.gnu.org
Subject: bug#40856: Feature request: support arbitrary propertized strings in wrap-prefix specifications
Date: Sun, 26 Apr 2020 13:23:15 -0400	[thread overview]
Message-ID: <6e0f2005-2c33-52eb-702a-b945ac1d09ac@gmail.com> (raw)
In-Reply-To: <83h7x65g68.fsf@gnu.org>

On 26/04/2020 13.07, Eli Zaretskii wrote:
>> Cc: 40856@debbugs.gnu.org
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Sun, 26 Apr 2020 12:09:31 -0400
>>
>>> wrap-prefix can have value that uses :align-to, so I don't see why
>>> you'd need to call window-text-pixel-size many times.  You could call> it once, and then use the result in the subsequent values of prefix.
>>
>> True, if the prefix is the same on every line.
>> But that calculation isn't very robust to changes in font sizes, other face options, and windows.
> 
> I don't think I follow.  :align-to accepts pixel specification, so it
> should be insensitive to font changes.

I typically want to align text relative to a prefix whose length depends on face properties, so if I use window-text-pixel-size, I need to redo the computation every time faces change.

>> I think that would be great; the cost should be reasonable, since 1. it only applies to the part of the buffer that is being displayed and 2. it won't be costlier than using the stirng being measured as the wrap prefix.
> 
> I don't think your 2. is necessarily correct, because you want the
> width computed each time the prefix spec is being used to produce
> glyphs, by which time the string is old history.
> 
>> IOW, if we expect that it wouldn't be too costly to use a given string as the wrap-prefix, then it shouldn't be too costly to use a specified space of that width as the wrap prefix.
> 
> I don't think I follow the logic.  You intend to use :space in the
> prefix spec, not the string.  So the display engine will have to
> perform layout of the string and compute its pixel width each time it
> produces a prefix for another line.  The string itself is either not
> actually displayed, or is displayed on the first line of the
> paragraph, before all the wrapped lines.  It may well be that
> redisplay needs to produce the display of just some lines, which don't
> even include the one with the string itself.

What I meant to say is that if it's cheap enough to draw this:

⟝ bbbbbbbbbbb
⟝ bbbbbbbbbbb
⟝ bbbbbbbbbbb
⟝ bbbbbbbbbbb
⟝ bbbbbbbbbbb

(where "⟝" is a wrap-prefix on all lines but the first)

… then it should be cheap enough to draw this:

⟝ bbbbbbbbbbb
   bbbbbbbbbbb
   bbbbbbbbbbb
   bbbbbbbbbbb
   bbbbbbbbbbb

where the indentation is a specified space as wide as "⟝".

Clément.





  reply	other threads:[~2020-04-26 17:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 21:24 bug#40856: Feature request: support arbitrary propertized strings in wrap-prefix specifications Clément Pit-Claudel
2020-04-26 15:33 ` Eli Zaretskii
2020-04-26 16:09   ` Clément Pit-Claudel
2020-04-26 17:07     ` Eli Zaretskii
2020-04-26 17:23       ` Clément Pit-Claudel [this message]
2020-04-26 17:43         ` Eli Zaretskii
2020-04-26 18:25           ` Clément Pit-Claudel

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=6e0f2005-2c33-52eb-702a-b945ac1d09ac@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=40856@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.