emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7d9f9d4d8e: doctex-mode: Try and fix bug#35140


From: Stefan Monnier
Subject: master 7d9f9d4d8e: doctex-mode: Try and fix bug#35140
Date: Tue, 15 Mar 2022 10:12:54 -0400 (EDT)

branch: master
commit 7d9f9d4d8e8b8836e317dc85dd757bb78200c20e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    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.
---
 lisp/textmodes/tex-mode.el | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index ab94036d01..aa6fd24518 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]