all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: d.williams@posteo.net, emacs-devel@gnu.org
Subject: Re: prettify-symbols-mode, derived modes, and compose-region
Date: Fri, 05 Mar 2021 10:51:00 -0500	[thread overview]
Message-ID: <jwvim65fvtv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83ft19y6cx.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Mar 2021 17:20:46 +0200")

>> > 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	other threads:[~2021-03-05 15:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 21:33 prettify-symbols-mode, derived modes, and compose-region D
2021-03-04 21:54 ` Eli Zaretskii
2021-03-05  0:22   ` D
2021-03-05  2:30     ` Stefan Monnier
2021-03-05  3:20       ` Stefan Kangas
2021-03-05  7:25         ` Eli Zaretskii
2021-03-05  7:18       ` Eli Zaretskii
2021-03-05 15:14         ` Stefan Monnier
2021-03-05 15:20           ` Eli Zaretskii
2021-03-05 15:51             ` Stefan Monnier [this message]
2021-03-05 15:57               ` Lars Ingebrigtsen
2021-03-05  7:08     ` Eli Zaretskii
2021-03-05 14:05       ` Clément Pit-Claudel
2021-03-05 21:24       ` D
2021-03-06  9:15         ` Eli Zaretskii
2021-03-06 10:43           ` D
2021-03-06 10:59             ` Eli Zaretskii

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=jwvim65fvtv.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=d.williams@posteo.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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.