[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-s

From: Tassilo Horn
Subject: Re: [Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbols-compose-p.
Date: Sat, 26 Sep 2015 07:36:09 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]