From: Yuan Fu Date: Fri, 3 Feb 2023 02:54:49 +0000 (-0800) Subject: ; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change. X-Git-Tag: emacs-29.0.90~515 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=671e5d9fad5;p=emacs.git ; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change. --- diff --git a/lisp/treesit.el b/lisp/treesit.el index 98f446a1456..6426eb08fe6 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -555,8 +555,12 @@ omitted, default END to BEG." "Generic tree-sitter font-lock error" 'treesit-error) +(defvar treesit-font-lock-settings) (defun treesit--font-lock-level-setter (sym val) - "Custom setter for `treesit-font-lock-level'." + "Custom setter for `treesit-font-lock-level'. +Set the default value of SYM to VAL, recompute fontification +features and refontify for every buffer where tree-sitter-based +fontification is enabled." (set-default sym val) (and (treesit-available-p) (named-let loop ((res nil) @@ -571,7 +575,7 @@ omitted, default END to BEG." res) (let ((buffer (car buffers))) (with-current-buffer buffer - (if (treesit-parser-list) + (if treesit-font-lock-settings (loop (append res (list buffer)) (cdr buffers)) (loop res (cdr buffers)))))))))