From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ikumi Keita <ikumi@ikumi.que.jp>
Cc: emacs-devel@gnu.org
Subject: Re: Giving "text quotes" syntax in font-lock-syntax-table only
Date: Tue, 02 Jun 2020 14:46:33 -0400 [thread overview]
Message-ID: <jwva71l1fhh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <55185.1589981051@localhost> (Ikumi Keita's message of "Wed, 20 May 2020 22:24:11 +0900")
Sorry for not getting back to you sooner.
I see you (plural) decided to switch to highlighting math elements using
regexps rather than the syntax-table. That sounds like a wise choice.
> This resembles the method to modify the major mode's syntax table
> (without setting `syntax-ppss-table'). It does eliminate the wrong
> fontification, but brings another problem in actual use cases of AUCTeX.
> When `syntax-ppss-table' is non-nil, all functions using `syntax-ppss'
> obey that syntax table, so they regard math expression $...$ as string
> constant. This can be problematic for cases like this:
Indeed. What you could do if you still want to use syntax-tables rather
than regexp, is to add an entry to the beginning of `font-lock-keywords`
which does the equivalent of `font-lock-fontify-syntactically-region`
but without using `syntax-ppss` and using its own syntax-table.
Maybe this actually argues that `font-lock-fontify-syntactically-region`
should use `font-lock-syntax-table` rather than `syntax-ppss-table` and
should refrain from using `syntax-ppss` when that syntax-table is
different from that of syntax-ppss.
Stefan
next prev parent reply other threads:[~2020-06-02 18:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 6:53 Giving "text quotes" syntax in font-lock-syntax-table only Ikumi Keita
2020-05-20 11:53 ` Stefan Monnier
2020-05-20 13:24 ` Ikumi Keita
2020-05-22 8:37 ` Ikumi Keita
2020-06-02 18:46 ` Stefan Monnier [this message]
2020-06-03 8:12 ` Ikumi Keita
2020-06-03 14:12 ` Stefan Monnier
2020-06-04 13:36 ` Ikumi Keita
2020-06-04 14:00 ` Stefan Monnier
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=jwva71l1fhh.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=ikumi@ikumi.que.jp \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).