From: Tassilo Horn <tsdh@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: Joost <joostkremers@fastmail.fm>, help-gnu-emacs@gnu.org
Subject: Re: [prettify-symbols-mode] Two consecutive matches don't work?
Date: Wed, 18 May 2022 12:54:41 +0200 [thread overview]
Message-ID: <875ym39k3d.fsf@gnu.org> (raw)
In-Reply-To: <87czgb17ei.fsf@gmail.com>
Robert Pluim <rpluim@gmail.com> writes:
> Joost> I'm dealing with some `.xml` files that contain data which uses the
> Joost> sequence `<<!` as some sort of operator. Because it's XML, the
> Joost> LESS-THAN sign needs to be encoded as `<`, yielding `<<!`.
>
> Joost> So I thought this would be the ideal use case for
> Joost> `prettify-symbols-mode`. I added `("<" . ?<)` to
> Joost> `prettify-symbols-alist` and activated the mode.
>
> Joost> Unfortunately, only the first `<` in each sequence is
> Joost> prettified. This seems to be due to the fact that the second `<` is
> Joost> followed by the exclamation mark: if I insert a space in between,
> Joost> prettification works.
>
> Joost> Is there any way to remedy this?
>
> Looks like a bug to me. I tried "<<", but exhibits the same
> behaviour.
The problem is that in <a><<</a> (symbol-at-point) on the first
< says "<a><" and on the second "<". I think there might be even
two bugs:
1. nxml-mode: It feels wrong that <a>< is considered a symbol. And
that the closing ; isn't part of the symbol < seems also not
correct. And why do < and > have symbol syntax. Wouldn't
open/close paren be more appropriate?
2. prettify-symbols: It seems wrong that the second < is prettified
because its not a single symbol but a symbol < plus the character
; which as punctuation syntax.
Bye,
Tassilo
next prev parent reply other threads:[~2022-05-18 10:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 9:32 [prettify-symbols-mode] Two consecutive matches don't work? Joost
2022-05-18 10:07 ` Robert Pluim
2022-05-18 10:54 ` Tassilo Horn [this message]
2022-05-19 17:46 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-05-19 19:09 ` Tassilo Horn
2022-05-18 11:56 ` Eli Zaretskii
2022-05-18 12:28 ` Robert Pluim
2022-05-18 20:01 ` Joost Kremers
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=875ym39k3d.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=help-gnu-emacs@gnu.org \
--cc=joostkremers@fastmail.fm \
--cc=rpluim@gmail.com \
/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.
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).