From: kobarity Date: Sun, 15 Dec 2024 14:02:51 +0000 (+0900) Subject: Fix hangs caused by unbalanced braces in Python f-strings X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;p=emacs.git 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) --- 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))))