[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 4d58d7d 09/30: Don't extend font lock region too
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 4d58d7d 09/30: Don't extend font lock region too eagerly (bug#42267) |
Date: |
Fri, 25 Sep 2020 11:00:12 -0400 (EDT) |
branch: externals/auctex
commit 4d58d7d1abd84feb7d975da3c9571a884756ff37
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Don't extend font lock region too eagerly (bug#42267)
* font-latex.el (font-latex-extend-region-backwards-quotation): If
there is no matching open quote, don't extend the font lock region.
---
font-latex.el | 40 +++++++++++++++++++++++++++-------------
1 file changed, 27 insertions(+), 13 deletions(-)
diff --git a/font-latex.el b/font-latex.el
index d7d26fa..09a6feb 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -2066,19 +2066,33 @@ set to french, and >>german<< (and 8-bit) are used if
set to german."
(setq opening-quote (car elt))
(throw 'found nil))))
;; Find opening quote taking nested quotes into account.
- (while (progn
- (re-search-backward (concat opening-quote "\\|"
- closing-quote)
- point-of-surrender 'move)
- (when (and (> (point) point-of-surrender)
- (not (bobp)))
- (if (string= (match-string 0) closing-quote)
- (setq nest-count (1+ nest-count))
- (when (/= nest-count 0)
- (setq nest-count (1- nest-count)))))))
- (when (< (point) font-lock-beg)
- (setq font-lock-beg (point))
- (throw 'extend t)))))))))
+ (while (and (re-search-backward (concat opening-quote "\\|"
+ closing-quote)
+ point-of-surrender t)
+ ;; Found quotes before point-of-surrender.
+ (cond ((string= (match-string 0) closing-quote)
+ ;; Encountered another closing quote.
+ ;; Increase nest-count and continue
+ ;; the inner loop.
+ (setq nest-count (1+ nest-count)))
+ ;; Found an opening quote.
+ ((/= nest-count 0)
+ ;; If in nest, decrease nest-count
+ ;; and continue the inner loop.
+ (setq nest-count (1- nest-count)))
+ ;; Else we arrived at the opening quote
+ ;; matching with the closing quote found
+ ;; in the outer loop.
+ ((< (point) font-lock-beg)
+ ;; If that opening quote locates
+ ;; before `font-lock-beg', break the
+ ;; outer loop and extend the region.
+ (setq font-lock-beg (point))
+ (throw 'extend t))
+ (t
+ ;; Else terminate the inner loop and
+ ;; continue the outer loop.
+ nil)))))))))))
(defun font-latex-match-script (limit)
"Match subscript and superscript patterns up to LIMIT."
- [elpa] externals/auctex e293844 07/30: ; Silence the compiler, (continued)
- [elpa] externals/auctex e293844 07/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 55e8842 15/30: Treat \choice like \item, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 971bece 14/30: Update style/csquotes.el to package version 5.2j, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex a17fee2 16/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 59b7942 17/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 07b79fc 24/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 087b030 28/30: Simplify mode line for emacs 27, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex b06ca0a 25/30: Fix document, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 0692e51 23/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 601e6a3 01/30: Get rid of gabage in generated texi file, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 4d58d7d 09/30: Don't extend font lock region too eagerly (bug#42267),
Tassilo Horn <=
- [elpa] externals/auctex d7cba92 21/30: Prepare for pdf output for PSTricks documents, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex a27850f 10/30: Fix previous commit and add new test, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 67ecb0b 18/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 255e768 11/30: Cater for case where fontification match goes over limit, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 92aa02b 29/30: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex be4a912 26/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 3ef28a5 20/30: Add an extra check for tex-buf.el in some style hooks, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex f04a508 22/30: Restore all math environments in texmathp.el, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 1bc7a21 30/30: ; Regenerate docs, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex ef1f670 27/30: ; Partially revert silencing the compiler, Tassilo Horn, 2020/09/25