'((t (:inherit font-lock-function-name-face)))
"Face used for section headings in `texinfo-mode'."
:group 'texinfo)
-(define-obsolete-face-alias 'texinfo-heading-face 'texinfo-heading "22.1")
-(defvar texinfo-heading-face 'texinfo-heading)
(defvar texinfo-font-lock-keywords
`(;; All but the first had an OVERRIDE of t.
;; 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)
;; (,texinfo-environment-regexp
;; 1 (texinfo-clone-environment (match-beginning 1) (match-end 1)) keep)
(,(concat "^@" (regexp-opt (mapcar 'car texinfo-section-list) t)
- ".*\n") 0 texinfo-heading-face t))
+ ".*\n")
+ 0 texinfo-heading t))
"Additional expressions to highlight in Texinfo mode.")
(defun texinfo-clone-environment (start end)
(unless (get-char-property start 'text-clones)
(if endp
(texinfo-last-unended-begin)
- (forward-word 1)
+ (forward-word-strictly 1)
(texinfo-next-unmatched-end))
(skip-syntax-forward "^w")
(when (looking-at
"Insert the matching `@end' for the last Texinfo command that needs one."
(ignore-errors
(save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(texinfo-last-unended-begin)
(or (match-string 1) '-)))
\n "@end " str \n \n)