[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 0ec28c6 13/27: Reconsider region extension
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 0ec28c6 13/27: Reconsider region extension |
Date: |
Sat, 27 Jun 2020 03:17:43 -0400 (EDT) |
branch: externals/auctex
commit 0ec28c63705b25824f1d9e6b7126e314d07f39b1
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Reconsider region extension
* font-latex.el (font-latex-fontify-region): Consider cases that
`font-lock-extend-region-functions' extends the region inside
`font-lock-default-fontify-region'. Use the return value from it to
construct the correct region.
(font-latex-match-math-env):
(font-latex-match-math-envII):
(font-latex-match-dollar-math):
Raise `font-latex--updated-region-end' to at least LIMIT when
necessary.
(font-latex--updated-region-end): Fix comments.
---
font-latex.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/font-latex.el b/font-latex.el
index 47c7e81..0cacddd 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1323,20 +1323,23 @@ then call `font-latex-set-syntactic-keywords'.")))
;; During hilighting of math expression, matched range sometimes exceeds
;; the given end limit. So record the actual end in this variable to
;; notify the font lock machinery.
-;; Initialized at each font lock operation to the end limit of font lock
-;; range. Match function of math expression should do the following two if
-;; the end of the actual match goes beyond the value of this variable:
-;; 1. Apply `font-lock-unfontify-region' between the value of this variable
-;; and the end of the actual match.
-;; 2. Update this variable to the end of the actual match.
+;; Match function of math expression should do the following two if
+;; the end of the actual match goes beyond the limit:
+;; 1. If the value of this variable is smaller than limit, set this
+;; variable to that limit.
+;; 2. When the end of the actual match exceeds this variable,
+;; - apply `font-lock-unfontify-region' between the value of this
+;; variable and the end of the actual match
+;; - update this variable to the end of the actual match
;; See implementation of `font-latex-match-math-env' for actual usage.
"Record the end of fontification.")
(defun font-latex-fontify-region (beg end &optional verbose)
"Fontify region from BEG to END.
Take care when the actually fonfified region was extended beyond END."
(setq font-latex--updated-region-end end)
- (font-lock-default-fontify-region beg end verbose)
- `(jit-lock-bounds ,beg . ,font-latex--updated-region-end))
+ (let ((res (font-lock-default-fontify-region beg end verbose)))
+ `(jit-lock-bounds ,(cadr res) .
+ ,(max (cddr res) font-latex--updated-region-end))))
;; Copy and adaption of `tex-font-lock-unfontify-region' from
;; tex-mode.el in GNU Emacs on 2004-08-04.
@@ -1746,7 +1749,12 @@ Used for patterns like:
(string= (match-string 1) close-tag))
;; Found closing tag.
(let ((p (point)))
- ;; If the closing tag is beyond `limit', take care of it.
+ (if (< font-latex--updated-region-end limit)
+ ;; *-extend-region-functions have extended the
+ ;; limit already.
+ (setq font-latex--updated-region-end limit))
+ ;; If the closing tag is beyond the current end of
+ ;; region, take care of it.
(when (< font-latex--updated-region-end p)
(font-lock-unfontify-region font-latex--updated-region-end p)
(setq font-latex--updated-region-end p))
@@ -1808,6 +1816,8 @@ The \\begin{equation} incl. arguments in the same line and
(+ limit font-latex-multiline-boundary) 'move)
(progn
(setq end (match-beginning 0))
+ (if (< font-latex--updated-region-end limit)
+ (setq font-latex--updated-region-end limit))
(when (< font-latex--updated-region-end end)
(font-lock-unfontify-region font-latex--updated-region-end end)
(setq font-latex--updated-region-end end)))
@@ -1837,6 +1847,8 @@ The \\begin{equation} incl. arguments in the same line and
(progn
(forward-char num)
(let ((p (point)))
+ (if (< font-latex--updated-region-end limit)
+ (setq font-latex--updated-region-end limit))
(when (< font-latex--updated-region-end p)
(font-lock-unfontify-region
font-latex--updated-region-end p)
- [elpa] externals/auctex a6b12a2 16/27: Update documents, (continued)
- [elpa] externals/auctex a6b12a2 16/27: Update documents, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 3d4f378 17/27: Fix typos, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 22d2eb6 20/27: Use constant regexp to fontify math environments, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 1855efd 21/27: ; * style/mathtools.el: A bit change to align with previous commit., Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 32ad0e2 04/27: Obsolete font-latex-update-font-lock (bug#37945), Tassilo Horn, 2020/06/27
- [elpa] externals/auctex f3df76a 09/27: Add support for algopseudocde style, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 54bb7c1 05/27: Omit hard font-lock reset also in font-latex-add-to-syntax-alist, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 9c105a2 06/27: Trigger refontification in font-latex-add-to-syntax-alist., Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 7a1ebbf 08/27: Add support for algorithm style, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 9170170 11/27: Delete overhead in extending font lock range of math expression, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 0ec28c6 13/27: Reconsider region extension,
Tassilo Horn <=
- [elpa] externals/auctex ababc71 14/27: Recover compatibility for older emacsen, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 393fb21 15/27: * texmathp.el: Add comment about additional bug., Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 0079026 19/27: ; * tests/latex/fontification-general.tex: Fix Indentation in environments., Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 4c0d150 22/27: Don't call TeX-remove-style in TeX-arg-document., Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 14a2b27 24/27: Improve conformance to code conventions, and documents, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 3c1f820 25/27: Add TODO item about remove-style feature, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex d9e148b 26/27: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 3a809a9 18/27: Fix regression of font lock, Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 3e1adad 23/27: ; * style/breqn.el (): Fix stupid mistake., Tassilo Horn, 2020/06/27
- [elpa] externals/auctex 1e8a495 27/27: Regenerate docs and tex-site.el after merge, Tassilo Horn, 2020/06/27