[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] GNU AUCTeX branch, font-latex-update, updated. 685e3049b7
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] GNU AUCTeX branch, font-latex-update, updated. 685e3049b7c28a2851bc76989c1753111e30c1f4 |
Date: |
Thu, 14 May 2020 04:58:07 -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, font-latex-update has been updated
via 685e3049b7c28a2851bc76989c1753111e30c1f4 (commit)
from a2874bcacd2a046e8a9edcfcfd6dc2a5f0c0ce69 (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 685e3049b7c28a2851bc76989c1753111e30c1f4
Author: Tassilo Horn <address@hidden>
Date: Thu May 14 10:57:51 2020 +0200
Use a custom syntax-propertize-function.
diff --git a/font-latex.el b/font-latex.el
index 1b98ae8..1448433 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1240,14 +1240,16 @@ triggers Font Lock to recognize the change."
(setq font-lock-set-defaults nil)
(font-latex-setup))
-(defun font-latex-set-syntax-propertize-function ()
- "Set `syntax-propertize-function' after updating the syntactic keywords."
- (font-latex-set-syntactic-keywords)
- (let ((keywords (if (derived-mode-p 'doctex-mode)
- font-latex-doctex-syntactic-keywords
- font-latex-syntactic-keywords)))
- (setq-local syntax-propertize-function
- (syntax-propertize-via-font-lock keywords))))
+(defun font-latex-syntax-propertize-function (start end)
+ "The `syntax-propertize-function' for (La)TeX documents."
+ (with-no-warnings
+ (let ((font-lock-syntactic-keywords
+ (if (derived-mode-p 'doctex-mode)
+ font-latex-doctex-syntactic-keywords
+ font-latex-syntactic-keywords)))
+ (font-lock-fontify-syntactic-keywords-region start end)
+ ;; In case it was eval'd/compiled.
+ (setq keywords font-lock-syntactic-keywords))))
;;;###autoload
(defun font-latex-setup ()
@@ -1276,6 +1278,8 @@ triggers Font Lock to recognize the change."
font-latex-extend-region-backwards-quotation
font-latex-extend-region-backwards-math-env
font-latex-extend-region-backwards-math-envII)
+ (syntax-propertize-function
+ . font-latex-syntax-propertize-function)
(syntax-propertize-extend-region-functions
syntax-propertize-wholelines
font-latex-sp-extend-region-backwards-verb-env))))
@@ -1293,8 +1297,7 @@ triggers Font Lock to recognize the change."
'((font-lock-syntactic-face-function
. font-latex-syntactic-face-function)))))
;; Set the defaults.
- (setq font-lock-defaults (append defaults variables))
- (font-latex-set-syntax-propertize-function))
+ (setq font-lock-defaults (append defaults variables)))
;; Make sure fontification will be refreshed if a user sets variables
;; influencing fontification in her file-local variables section.
@@ -1306,7 +1309,7 @@ If SYNTACTIC-KWS is non-nil, also update
`font-latex-syntactic-keywords'."
;; Update syntactic keywords.
(when syntactic-kws
- (font-latex-set-syntax-propertize-function))
+ (font-latex-set-syntactic-keywords))
;; Let font-lock recompute its fontification rules.
(setq font-lock-set-defaults nil)
-----------------------------------------------------------------------
Summary of changes:
font-latex.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
hooks/post-receive
--
GNU AUCTeX
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [AUCTeX-diffs] GNU AUCTeX branch, font-latex-update, updated. 685e3049b7c28a2851bc76989c1753111e30c1f4,
Tassilo Horn <=