]> code.delx.au - gnu-emacs/commitdiff
Allow highlighting things like @math{2^{12}}
authorBastien Guerry <bzg@altern.org>
Wed, 24 Feb 2016 03:35:28 +0000 (14:35 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 24 Feb 2016 03:35:28 +0000 (14:35 +1100)
* lisp/textmodes/texinfo.el (texinfo-font-lock-keywords):
Allow highlighting things like @math{2^{12}} (bug#16390).

lisp/textmodes/texinfo.el

index 8f4359875147c531aa3b7597b81f9ca6e8e7e969..12a991163b3fdd251f326349a38a8f1dace92f24 100644 (file)
@@ -368,8 +368,10 @@ Subexpression 1 is what goes into the corresponding `@end' 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)