]> git.eshelyaron.com Git - emacs.git/commitdiff
Make python.el compatible with Emacs 29.1
authorStefan Kangas <stefankangas@gmail.com>
Tue, 11 Mar 2025 00:14:35 +0000 (01:14 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Mar 2025 18:56:11 +0000 (19:56 +0100)
* lisp/progmodes/python.el (python--treesit-fontify-string): Don't
call treesit--compute-font-lock-level unless it is
fboundp.  (Bug#76873)

(cherry picked from commit 46f9ebaec309e45d4a1a19d1a5e69eab881d54e9)

lisp/progmodes/python.el

index 8ff43d0720bfa0d7a4d865f0b8e21b8e92787028..f2818b560660a2cd768b710376927e8a90fe66da 100644 (file)
@@ -1102,11 +1102,14 @@ fontified."
                    'font-lock-doc-face
                  'font-lock-string-face))
 
-         (ignore-interpolation (not
-                                (seq-some
-                                 (lambda (feats) (memq 'string-interpolation feats))
-                                 (seq-take treesit-font-lock-feature-list
-                                           (treesit--compute-font-lock-level treesit-font-lock-level)))))
+         (ignore-interpolation
+          (not (seq-some
+                (lambda (feats) (memq 'string-interpolation feats))
+                (seq-take treesit-font-lock-feature-list
+                          (if (fboundp 'treesit--compute-font-lock-level)
+                              (treesit--compute-font-lock-level
+                               treesit-font-lock-level)
+                            treesit-font-lock-level)))))
          ;; If interpolation is enabled, highlight only
          ;; string_start/string_content/string_end children.  Do not
          ;; touch interpolation node that can occur inside of the