--- font-latex.el.~5.191.~ 2010-09-12 11:47:59.000000000 +0200 +++ font-latex.el 2010-11-23 22:15:54.000000000 +0100 @@ -841,6 +841,15 @@ The form should be the same as in `font-lock-syntactic-keywords'.") (make-variable-buffer-local 'font-latex-syntactic-keywords-extra) +(defun font-latex-propertize-verb-macro-with-braces (start end) + "Put syntax properties on a verbatim macro with braces. +START is the position just behind the opening brace and END is +the position just before the closing brace." + (if (= (- end start) 1) + (put-text-property start (1+ start) 'syntax-table (string-to-syntax ".")) + (put-text-property start (1+ start) 'syntax-table (string-to-syntax "|")) + (put-text-property (1- end) end 'syntax-table (string-to-syntax "|")))) + (defun font-latex-set-syntactic-keywords () "Set the variable `font-latex-syntactic-keywords'. This function can be used to refresh the variable in case other @@ -894,8 +903,9 @@ (unless (= (length verb-macros-with-braces) 0) (add-to-list 'font-latex-syntactic-keywords `(,(concat "\\\\\\(?:" verb-macros-with-braces "\\)" - "\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)") - (1 "|") (2 "|"))))) + "{\\(.*?[^\\]\\(?:\\\\\\\\\\)*\\)}") + (1 (ignore (font-latex-propertize-verb-macro-with-braces + (match-beginning 1) (match-end 1)))))))) (when font-latex-syntactic-keywords-extra (nconc font-latex-syntactic-keywords font-latex-syntactic-keywords-extra)) ;; Cater for docTeX mode.