From: Tassilo Horn <tsdh@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbols-compose-p.
Date: Sat, 26 Sep 2015 07:36:09 +0200 [thread overview]
Message-ID: <87612xlp2u.fsf@gnu.org> (raw)
In-Reply-To: <jwvzj09hjn1.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Sat, 26 Sep 2015 00:54:49 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> - ;; Don't compose inside verbatim blocks!
>> - (nth 8 (syntax-ppss))
> [...]
>> + ;; Don't compose inside verbatim blocks.
>> + (let* ((face (get-text-property end 'face))
>> + (faces (if (consp face) face (list face))))
>> + (or (memq 'tex-verbatim faces)
>> + (memq 'font-latex-verbatim-face faces)))))))
>
> Rather than check the `face' property, I think it'd be more robust to
> use the (syntax-ppss) data. Since tex-env-mark uses "< c" for the
> syntax of \begin{verbatim}, A test like
>
> (eq 2 (nth 7 (syntax-ppss)))
>
> should do the trick.
>
> Stefan "at least for the non-font-latex case"
Yes, but only for the non-font-latex case. With font-latex, using the
8th ppss data will omit prettification in $...$ because those are treated
as strings at fontification time, and it also doesn't give comment
syntax to verbatim stuff.
But if you prefer, I can use your check in
`tex--prettify-symbols-compose-p' and have a font-latex-specific
`prettify-symbols-compose-predicate' in AUCTeX which would go like
(and (tex--prettify-symbols-compose-p start end match)
(not (let ((face (get-text-property end 'face)))
(if (consp face)
(memq 'font-latex-verbatim-face face)
(eq face 'font-latex-verbatim-face))))
Bye,
Tassilo
next prev parent reply other threads:[~2015-09-26 5:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150925210512.18505.12538@vcs.savannah.gnu.org>
[not found] ` <E1ZfaB6-0004p6-FL@vcs.savannah.gnu.org>
2015-09-26 4:54 ` [Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbols-compose-p Stefan Monnier
2015-09-26 5:36 ` Tassilo Horn [this message]
2015-09-26 5:46 ` Tassilo Horn
2015-09-29 11:29 ` Artur Malabarba
2015-09-29 12:31 ` Tassilo Horn
2015-09-29 13:14 ` Artur Malabarba
2015-09-30 6:46 ` Tassilo Horn
2015-09-30 7:48 ` Artur Malabarba
[not found] ` <B393F5AD12955C48A84FFB08032CD04F6C218AED@ECS-EXG-P-MB01.win.lanl.gov>
2015-09-30 7:51 ` Artur Malabarba
2015-09-30 8:59 ` Tassilo Horn
2015-09-30 10:08 ` Artur Malabarba
2015-09-30 10:45 ` Tassilo Horn
2015-09-30 11:12 ` Artur Malabarba
2015-09-30 11:29 ` Tassilo Horn
2015-10-01 1:17 ` Artur Malabarba
2015-10-01 11:43 ` Tassilo Horn
2015-10-01 1:19 ` Artur Malabarba
2015-10-01 11:45 ` Tassilo Horn
2015-09-29 19:46 ` Tassilo Horn
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=87612xlp2u.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=emacs-devel@gnu.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 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).