diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-03-15 10:12:46 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-03-15 10:12:46 -0400 |
commit | 7d9f9d4d8e8b8836e317dc85dd757bb78200c20e (patch) | |
tree | a01afd42e1210120501547d21cc30bd32753c512 | |
parent | 55bcad776de9b7ca0047c78229390a4aa11a82ca (diff) | |
download | emacs-7d9f9d4d8e8b8836e317dc85dd757bb78200c20e.tar.gz |
doctex-mode: Try and fix bug#35140
* lisp/textmodes/tex-mode.el (doctex-syntax-propertize-rules):
Add support for the new ^^X and consider the first ^ of ^^A to be the
closing char for the previous comment.
(doctex-font-lock-^^A): Simplify accordingly.
-rw-r--r-- | lisp/textmodes/tex-mode.el | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index ab94036d01d..aa6fd245188 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2989,13 +2989,7 @@ There might be text before point." (put-text-property (1- (match-beginning 1)) (match-beginning 1) 'syntax-table - (if (= (1+ (line-beginning-position)) (match-beginning 1)) - ;; The `%' is a single-char comment, which Emacs - ;; syntax-table can't deal with. We could turn it - ;; into a non-comment, or use `\n%' or `%^' as the comment. - ;; Instead, we include it in the ^^A comment. - (string-to-syntax "< b") - (string-to-syntax ">"))) + (string-to-syntax ">")) (let ((end (line-end-position))) (if (< end (point-max)) (put-text-property @@ -3018,8 +3012,9 @@ There might be text before point." (defconst doctex-syntax-propertize-rules (syntax-propertize-precompile-rules latex-syntax-propertize-rules - ;; For DocTeX comment-in-doc. - ("\\(\\^\\)\\^A" (1 (doctex-font-lock-^^A)))))) + ;; For DocTeX comment-in-doc (DocTeX ≥3 also allows ^^X). + ;; We make the comment start on the second char because of bug#35140. + ("\\^\\(\\^\\)[AX]" (1 (doctex-font-lock-^^A)))))) (defvar doctex-font-lock-keywords (append tex-font-lock-keywords |