diff options
| author | kobarity | 2024-12-15 23:02:51 +0900 |
|---|---|---|
| committer | Stefan Monnier | 2024-12-15 10:03:02 -0500 |
| commit | 3c247f86b7639995c8ce2627049bcc91452d2cca (patch) | |
| tree | 8f073ff5fd647c502ad99af0c3dcbfa562b16da1 /lisp/progmodes/python.el | |
| parent | 75e3ea042393581c2082dc5c89628c544f2de948 (diff) | |
| download | emacs-3c247f86b7639995c8ce2627049bcc91452d2cca.tar.gz emacs-3c247f86b7639995c8ce2627049bcc91452d2cca.zip | |
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)
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5729b12573f..493eab5e611 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -623,7 +623,8 @@ the {...} holes that appear within f-strings." | |||
| 623 | (forward-char 1) ;Just skip over {{ | 623 | (forward-char 1) ;Just skip over {{ |
| 624 | (let ((beg (match-beginning 0)) | 624 | (let ((beg (match-beginning 0)) |
| 625 | (end (condition-case nil | 625 | (end (condition-case nil |
| 626 | (let ((parse-sexp-ignore-comments)) | 626 | (let ((forward-sexp-function) |
| 627 | (parse-sexp-ignore-comments)) | ||
| 627 | (up-list 1) | 628 | (up-list 1) |
| 628 | (min send (point))) | 629 | (min send (point))) |
| 629 | (scan-error send)))) | 630 | (scan-error send)))) |