From 77962b8c74fec24324abace3dde5e5aaf5c43f26 Mon Sep 17 00:00:00 2001 From: kobarity Date: Sun, 15 Dec 2024 23:02:51 +0900 Subject: [PATCH] Fix hangs caused by unbalanced braces in Python f-strings * lisp/progmodes/python.el (python--font-lock-f-strings): Temporarily bind forward-sexp-function to nil when calling 'up-list'. (Bug#74738) (cherry picked from commit 3c247f86b7639995c8ce2627049bcc91452d2cca) --- lisp/progmodes/python.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 477200b5720..47fb818c78e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -617,7 +617,8 @@ the {...} holes that appear within f-strings." (forward-char 1) ;Just skip over {{ (let ((beg (match-beginning 0)) (end (condition-case nil - (let ((parse-sexp-ignore-comments)) + (let ((forward-sexp-function) + (parse-sexp-ignore-comments)) (up-list 1) (min send (point))) (scan-error send)))) -- 2.39.2