From: Eli Zaretskii <eliz@gnu.org>
To: D <d.williams@posteo.net>
Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: prettify-symbols-mode, derived modes, and compose-region
Date: Sat, 06 Mar 2021 11:15:11 +0200 [thread overview]
Message-ID: <83r1kswsm8.fsf@gnu.org> (raw)
In-Reply-To: <18caf24f-fb5d-616d-fb24-393f7d2149f7@posteo.net> (message from D on Fri, 5 Mar 2021 22:24:44 +0100)
> From: D <d.williams@posteo.net>
> Cc: emacs-devel@gnu.org
> Date: Fri, 5 Mar 2021 22:24:44 +0100
>
> > And that's even before you consider
> > complex text shaping which could combine several codepoints into a
> > single wide grapheme cluster.
>
> I don't think that using a character capable of that would be of any
> use as a decorative element.
I was talking about the need to align the "decorative elements" with
text that includes such grapheme clusters.
> > Anyway, I think it should be very easy to add a new display property
> > type that would override the pixel width of a font glyph with a fixed
> > value calculated in some way by a Lisp program.
>
> That would of course be the perfect solution. But, doesn't this have
> to exist in one way or another already? For example, the checkbox
> widget in custom interfaces to my knowledge visually replaces a simple
> "[X]" with a bitmap. When I examine a checkbox with C-u C-x = it
> seems to be the case that display does the legwork and somehow obtains
> the image size from the xpm file (I suppose).
In your original use case you didn't have images, you had characters.
Or did I misunderstand?
> Same with superstar, essentially. For example, every decorative
> bullet can have a "fallback character" for terminal displays, and this
> behaves correctly from the perspective of the frame you opened the
> buffer with. I include a simple redisplay command for emacsclient
> users for this reason. So I suppose I operate under the same
> limitations as shr?
Yes, I think so. And on text terminals this issue is moot anyway,
because every character takes a single column (if you forget about
those rare ones that take 2).
> In that case, I probably should look into that character size
> function. Could you point me in the right general direction? I'm not
> quite sure how to find it.
shr-fill-line, I guess.
You can also try using font-get-glyphs, it might be more suitable for
your needs. I think shr.el doesn't use it because that turned out to
be slower than the current approach, but your use case is different.
next prev parent reply other threads:[~2021-03-06 9:15 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
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 [this message]
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=83r1kswsm8.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=d.williams@posteo.net \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.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 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.