emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/backports-25.2 70244eb 15/46: Allow highlighting t


From: Noam Postavsky
Subject: [Emacs-diffs] scratch/backports-25.2 70244eb 15/46: Allow highlighting things like @math{2^{12}}
Date: Sun, 2 Oct 2016 14:04:48 +0000 (UTC)

branch: scratch/backports-25.2
commit 70244ebc4263f833251364995a8561765301bae1
Author: Bastien Guerry <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Allow highlighting things like @math{2^{12}}
    
    * lisp/textmodes/texinfo.el (texinfo-font-lock-keywords):
    Allow highlighting things like @math{2^{12}} (bug#16390).
    
    (cherry picked from commit 3c36fc13c9eb78af073008d2b5f0d8a295110df1)
---
 lisp/textmodes/texinfo.el |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index c22f531..ed6022f 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -368,8 +368,10 @@ Subexpression 1 is what goes into the corresponding 
address@hidden' statement.")
     ;; their arguments frequently include a @@, and we don't want that
     ;; to overwrite the normal fontification of the argument.
     ("@\\(file\\|email\\){\\([^}]+\\)" 2 font-lock-string-face keep)
-    ("@\\(samp\\|code\\|var\\|math\\|env\\|command\\|option\\){\\([^}]+\\)"
+    ("@\\(samp\\|code\\|var\\|env\\|command\\|option\\){\\([^}]+\\)"
      2 font-lock-variable-name-face keep)
+    ;; @math allows nested braces like @math{2^{12}}
+    ("@math{\\([^{}]*{?[^{}]*}?[^{}]*\\)}" 1 font-lock-variable-name-face)
     ("@\\(cite\\|x?ref\\|pxref\\|dfn\\|inforef\\){\\([^}]+\\)"
      2 font-lock-constant-face)
     ("@\\(anchor\\){\\([^}]+\\)" 2 font-lock-type-face)



reply via email to

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