diff options
| author | Stefan Kangas | 2025-03-11 01:14:35 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-03-11 01:14:35 +0100 |
| commit | 46f9ebaec309e45d4a1a19d1a5e69eab881d54e9 (patch) | |
| tree | 4a5d2afd5eda7d492e25976e582159485e8f5748 /lisp/progmodes/python.el | |
| parent | 8ea65ac642c5ae29610ef6a14f852953821dee45 (diff) | |
| download | emacs-46f9ebaec309e45d4a1a19d1a5e69eab881d54e9.tar.gz emacs-46f9ebaec309e45d4a1a19d1a5e69eab881d54e9.zip | |
Make python.el compatible with Emacs 29.1
* lisp/progmodes/python.el (python--treesit-fontify-string): Don't
call treesit--compute-font-lock-level unless it is
fboundp. (Bug#76873)
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index fa9dd636f1d..9dd7b2eb760 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1108,11 +1108,14 @@ fontified." | |||
| 1108 | 'font-lock-doc-face | 1108 | 'font-lock-doc-face |
| 1109 | 'font-lock-string-face)) | 1109 | 'font-lock-string-face)) |
| 1110 | 1110 | ||
| 1111 | (ignore-interpolation (not | 1111 | (ignore-interpolation |
| 1112 | (seq-some | 1112 | (not (seq-some |
| 1113 | (lambda (feats) (memq 'string-interpolation feats)) | 1113 | (lambda (feats) (memq 'string-interpolation feats)) |
| 1114 | (seq-take treesit-font-lock-feature-list | 1114 | (seq-take treesit-font-lock-feature-list |
| 1115 | (treesit--compute-font-lock-level treesit-font-lock-level))))) | 1115 | (if (fboundp 'treesit--compute-font-lock-level) |
| 1116 | (treesit--compute-font-lock-level | ||
| 1117 | treesit-font-lock-level) | ||
| 1118 | treesit-font-lock-level))))) | ||
| 1116 | ;; If interpolation is enabled, highlight only | 1119 | ;; If interpolation is enabled, highlight only |
| 1117 | ;; string_start/string_content/string_end children. Do not | 1120 | ;; string_start/string_content/string_end children. Do not |
| 1118 | ;; touch interpolation node that can occur inside of the | 1121 | ;; touch interpolation node that can occur inside of the |