[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 40b9319 7/8: Fix matching of scri
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 40b9319 7/8: Fix matching of script chars (bug#48012) |
Date: |
Sun, 25 Apr 2021 15:22:52 -0400 (EDT) |
branch: externals/auctex
commit 40b9319b80cd5ad6892126b03599cdc626837d59
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>
Fix matching of script chars (bug#48012)
* font-latex.el (font-latex-match-script-chars): Don't stop after
findind the first script char which turns out not to be an actual
script char (bug#48012).
---
font-latex.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/font-latex.el b/font-latex.el
index 7ba3792..906afc9 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -2141,19 +2141,21 @@ set to french, and >>german<< (and 8-bit) are used if
set to german."
(defun font-latex-match-script-chars (limit)
"Match subscript and superscript chars up to LIMIT."
- (and (re-search-forward "[^_^]\\([_^]\\)" limit t)
- (let ((pos (match-beginning 1)))
- (and (font-latex-faces-present-p 'font-latex-math-face pos)
- (not (font-latex-faces-present-p '(font-lock-constant-face
- font-lock-builtin-face
- font-lock-comment-face
- font-latex-verbatim-face)
pos))
- ;; Check for backslash quoting
- (not (let ((odd nil)
- (pos pos))
- (while (eq (char-before pos) ?\\)
- (setq pos (1- pos) odd (not odd)))
- odd))))))
+ (catch 'found
+ (while (re-search-forward "[^_^]\\([_^]\\)" limit t)
+ (let ((pos (match-beginning 1)))
+ (when (and (font-latex-faces-present-p 'font-latex-math-face pos)
+ (not (font-latex-faces-present-p '(font-lock-constant-face
+ font-lock-builtin-face
+ font-lock-comment-face
+
font-latex-verbatim-face) pos))
+ ;; Check for backslash quoting
+ (not (let ((odd nil)
+ (pos pos))
+ (while (eq (char-before pos) ?\\)
+ (setq pos (1- pos) odd (not odd)))
+ odd)))
+ (throw 'found t))))))
(defun font-latex--get-script-props (pos script-type)
(let* ((old-raise (or (plist-get (get-text-property pos 'display) 'raise)
0.0))
- [AUCTeX-diffs] [elpa] externals/auctex updated (0383415 -> 3c4c78b), Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex b641204 1/8: Improve handling for parentheses with electric-pair-mode (bug#47936), Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex 98455d0 6/8: Give explicit arg to LaTeX-back-to-indentation in filling functions., Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex 40b9319 7/8: Fix matching of script chars (bug#48012),
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 93363d3 3/8: Follow up previous commit, Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex d1d99ae 2/8: Get rid of unexpected side effects, Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex 3d813cd 4/8: Add new test, Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex 6d3ecf3 5/8: Don't treat comments with whitespace before % as code comments, Tassilo Horn, 2021/04/25
- [AUCTeX-diffs] [elpa] externals/auctex 3c4c78b 8/8: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2021/04/25