emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prettify-symbols-mode, derived modes, and compose-region


From: Stefan Monnier
Subject: Re: prettify-symbols-mode, derived modes, and compose-region
Date: Fri, 05 Mar 2021 10:51:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> > If the width of the additional space is known, there's also the :width
>> > display property.
>> 
>> Indeed, there's `:width` but in the case under discussion the desired
>> with of the space is something like `1 - width-of-previous-char`, IOW
>> something ELisp can't know when it puts the text property.
>
> Yes, it can: shr.el uses these capabilities.

IIRC you can query Emacs about the size the character would have if it
were to be displayed right now in the currently selected window.
But you don't know that it's the same size as the character will have
when it will actually be displayed (and that char could have
simultaneously two different sizes in two different windows, of course).

I guess we could extend the "pixel specification for spaces" so you can
use "the width of this char" or "the width of that string" in your
computation, but it sounds pretty ugly ;-)


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]