]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix hangs caused by unbalanced braces in Python f-strings main
authorkobarity <kobarity@gmail.com>
Sun, 15 Dec 2024 14:02:51 +0000 (23:02 +0900)
committerEshel Yaron <me@eshelyaron.com>
Sun, 15 Dec 2024 21:05:37 +0000 (22:05 +0100)
* 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

index 477200b57207de10a89eb0c4d59c274b34519b39..47fb818c78e9b9c781edea9630343e805577775a 100644 (file)
@@ -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))))