auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 3a809a9684eaebb0e23bc


From: Ikumi Keita
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 3a809a9684eaebb0e23bcf2774747891c5b93a57
Date: Tue, 16 Jun 2020 07:19:33 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  3a809a9684eaebb0e23bcf2774747891c5b93a57 (commit)
      from  3d4f37856a55db4ee24550b1a2bc1aae8f877aed (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3a809a9684eaebb0e23bcf2774747891c5b93a57
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Date:   Mon Jun 15 02:51:10 2020 +0900

    Fix regression of font lock
    
    * font-latex.el (font-latex-match-math-envII): Store the position of
    "\begin{foo}" as (match-beginnig 0) so that `font-lock-multiline' text
    property covers it. Store the range of math expression as
    subexpression 1.
    (font-latex-make-user-keywords): Arrange in accord with the above
    change.

diff --git a/font-latex.el b/font-latex.el
index 449c2d1..ad2153f 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -849,7 +849,7 @@ Generated by `font-latex-make-user-keywords'.")))
              (0 'font-latex-warning-face t t)
              (1 'font-latex-math-face append t))
             (font-latex-match-math-envII
-             (0 'font-latex-math-face append t))
+             (1 'font-latex-math-face append t))
             (font-latex-match-simple-command
              (0 'font-latex-sedate-face append))
             (font-latex-match-script
@@ -1810,13 +1810,13 @@ The \\begin{equation} incl. arguments in the same line 
and
                                   ;; the \end{<env>} construct below
                                   "\\(\\*?}\\)"
                                   ;; Match an optional and possible
-                                  ;; mandatory argument(s) as long as
-                                  ;; they are on the same line with
-                                  ;; no spaces in-between
+                                  ;; mandatory argument(s). They can
+                                  ;; span multiple lines.
                                   
"\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
                                   "\\(?:{[^}]*}\\)*")
                           limit t)
-    (let ((beg (match-end 0)) end)
+    (let ((beg (match-end 0)) end
+         (beg-of-begin (match-beginning 0)))
       (if (re-search-forward (concat "\\\\end[ \t]*{"
                                     (regexp-quote
                                      (buffer-substring-no-properties
@@ -1831,8 +1831,12 @@ The \\begin{equation} incl. arguments in the same line 
and
              (font-lock-unfontify-region font-latex--updated-region-end end)
              (setq font-latex--updated-region-end end)))
        (goto-char beg)
-       (setq end beg))
-      (store-match-data (list beg end))
+       (setq end beg
+             beg-of-begin beg))
+      ;; Store the position of "\begin{foo}" as (match-beginnig 0) so
+      ;; that `font-lock-multiline' text property covers it. This keeps
+      ;; editing inside multi-line optional argument sane.
+      (store-match-data (list beg-of-begin end beg end))
       t)))
 
 (defun font-latex-match-dollar-math (limit)

-----------------------------------------------------------------------

Summary of changes:
 font-latex.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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