Subject: 29.0.50; Font locking not enabling for ts-mode

From: Theodor Thornhill <[email-masked]>
Date: Mon, 24 Oct 2022 08:43:29 +0200

Hi Yuan!

It seems we cannot really enable font-lock without setting the
font-lock-defaults to some non-nil value.

I'm not really sure why the 'treesit-font-lock-enable' isn't sufficient,
but here's a patch that at least makes ts-mode usable again :)

Thanks,
Theo

>From 23d172e17330e5c5d3403fdfacddedfbc91f5b90 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <[email-masked]>
Date: Mon, 24 Oct 2022 08:35:05 +0200
Subject: [PATCH] Add in check for font-lock-defaults

* lisp/progmodes/ts-mode.el (ts-mode): It seems font-lock-defaults has
to be set in order for font-locking to work.  Add in a guard so that
ts-mode can font-lock.
---
 lisp/progmodes/ts-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/progmodes/ts-mode.el b/lisp/progmodes/ts-mode.el
index c23f2bec05..11e5677e28 100644
--- a/lisp/progmodes/ts-mode.el
+++ b/lisp/progmodes/ts-mode.el
@@ -276,6 +276,8 @@ ts-mode
                       "function_declaration"
                       "lexical_declaration")))
   ;; Font-lock.
+  (unless font-lock-defaults
+    (setq-local font-lock-defaults '(nil t)))
   (setq-local treesit-font-lock-settings ts-mode--font-lock-settings)
   (setq-local treesit-font-lock-feature-list '((minimal) (moderate) (full)))
 
-- 
2.34.1