From e9d1367a32f1a6a9d637f14b2326e19e58762acc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 5 Jun 2026 12:43:43 -0400 Subject: [PATCH] paren.el: Fix part of bug#81035 * lisp/paren.el (show-paren--default): Syntax-propertize before narrowing. --- lisp/paren.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/paren.el b/lisp/paren.el index 10c72dadc79..c2ecdc60c72 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -272,9 +272,14 @@ It is the default value of `show-paren-data-function'." (save-restriction ;; Determine the range within which to look for a match. (when blink-matching-paren-distance - (narrow-to-region - (max (point-min) (- (point) blink-matching-paren-distance)) - (min (point-max) (+ (point) blink-matching-paren-distance)))) + (let ((beg (max (point-min) + (- (point) blink-matching-paren-distance)))) + ;; `syntax-propertize' can't widen so make sure it won't + ;; need to (bug#81035). + (syntax-propertize beg) + (narrow-to-region + beg + (min (point-max) (+ (point) blink-matching-paren-distance))))) ;; Scan across one sexp within that range. ;; Errors or nil mean there is a mismatch. (condition-case ()