branch: externals/auctex
commit b7efe049d4f732083bb12a71879b2c21a863e88b
Author: Stefan Monnier <[email protected]>
Commit: Arash Esbati <[email protected]>
Fix 'syntax-propertize because of narrowing!' error
* texmathp.el (texmathp-match-macro): Syntax-propertize before
narrowing. (Emacs bug#81035)
---
texmathp.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/texmathp.el b/texmathp.el
index b900ecd845d..7dd443a0150 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -1,6 +1,6 @@
;;; texmathp.el -- Code to check if point is inside LaTeX math environment
-*- lexical-binding: t; -*-
-;; Copyright (C) 1998-2024 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2026 Free Software Foundation, Inc.
;; Author: Carsten Dominik <[email protected]>
;; Maintainer: [email protected]
@@ -395,6 +395,9 @@ Limit searches to BOUND. The return value is like
(\"\\macro\" . (point))."
(save-restriction
(save-excursion
(set-syntax-table texmathp-syntax-table)
+ ;; `syntax-propertize' can't widen so make sure it won't
+ ;; need to (Emacs bug#81035).
+ (syntax-propertize (max 1 bound))
(narrow-to-region (max 1 bound) (point))
;; Move back out of the current parenthesis
(while (condition-case nil (progn (up-list -1) t) (error nil))