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)
This commit is contained in:
Stefan Kangas 2025-03-11 01:14:35 +01:00
parent 8ea65ac642
commit 46f9ebaec3

View file

@ -1108,11 +1108,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