emacs-devel
[Top][All Lists]
Advanced

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

Re: port x-symbol to GNU emacs 24.


From: Tassilo Horn
Subject: Re: port x-symbol to GNU emacs 24.
Date: Wed, 19 Aug 2015 18:34:40 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Hi again,

I finally found out what's the culprit.  AUCTeX' font-latex uses
syntactic font-lock for the tex math construct $ ... $, i.e., for
fontification purposes it gives $ string-syntax and then uses a custom
`font-lock-syntactic-face-function' to assign either string, comment, or
math face.

So basically, the value of

(defvar font-latex-syntax-alist
  ;; Use word syntax for @ because we use \> for matching macros and
  ;; we don't want address@hidden to be found if we search for \foo.
  '((?\( . ".") (?\) . ".") (?$ . "\"") (?@ . "w"))
  "List of specifiers for the syntax alist of `font-lock-defaults'.")

is used as SYNTAX-ALIST in `font-lock-defaults'.

I have no clue why parens get punctuation syntax, though.  I checked the
VC history, and back in the old times there was a comment

  ;; Parentheses () disabled because they should not delimit fontification
  ;; in LaTeX text.

whatever that means.  But that's the reason why \(\alpha\) is not
prettified but \( \alpha\) is: there mustn't be a character with
punctuation syntax before the symbol to be prettified.  (I think that's
probably sensible in C-like languages but not in TeX or Lisp.)

Is there a way that I can use a custom SYNTAX-ALIST only for syntactic
but not search-based fontification?

Bye,
Tassilo



reply via email to

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