summaryrefslogtreecommitdiff
path: root/lisp/textmodes/texinfo.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes/texinfo.el')
-rw-r--r--lisp/textmodes/texinfo.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index c22f531440d..12a991163b3 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -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)
@@ -391,7 +393,7 @@ Subexpression 1 is what goes into the corresponding `@end' statement.")
(unless (get-char-property start 'text-clones)
(if endp
(texinfo-last-unended-begin)
- (forward-word-strictly 1)
+ (forward-word 1)
(texinfo-next-unmatched-end))
(skip-syntax-forward "^w")
(when (looking-at
@@ -736,7 +738,7 @@ With prefix argument or inside @code or @example, inserts a plain \"."
"Insert the matching `@end' for the last Texinfo command that needs one."
(ignore-errors
(save-excursion
- (backward-word-strictly 1)
+ (backward-word 1)
(texinfo-last-unended-begin)
(or (match-string 1) '-)))
\n "@end " str \n \n)