From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58755: 29.0.50; Font locking not enabling for ts-mode Date: Mon, 24 Oct 2022 08:43:29 +0200 Message-ID: <87czah3eni.fsf@thornhill.no> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28026"; mail-complaints-to="usenet@ciao.gmane.io" To: 58755@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 24 08:45:21 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omrD7-00077m-Fo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 08:45:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omrCE-0008Hd-LP; Mon, 24 Oct 2022 02:44:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omrBr-00082h-2X for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 02:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omrBq-0007sl-N4 for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 02:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omrBq-00042y-Ai for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 02:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2022 06:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58755 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166659382315521 (code B ref -1); Mon, 24 Oct 2022 06:44:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2022 06:43:43 +0000 Original-Received: from localhost ([127.0.0.1]:46860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omrBX-00042G-GV for submit@debbugs.gnu.org; Mon, 24 Oct 2022 02:43:43 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omrBW-000428-35 for submit@debbugs.gnu.org; Mon, 24 Oct 2022 02:43:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omrBV-000796-Aw for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 02:43:41 -0400 Original-Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omrBM-0007nf-ST for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 02:43:41 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1666593810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=WpfQckLwwAcAnBW4O/NJvjmPm/Jm4y8rUYSbeTxHs8I=; b=kOp5F2vohsU4XOY3vgfOEymAvGJN432gMlmc/zxFx9YL/L0WNy/Emelm7DpmPAqPTu2uMu sd7kHPx91z5TBg5/Dgdn0vuGOekklz6tNi1LRxoMPrOI3lZzdrXRYBYqjbqvuKmmKIuTF2 YU8KHM1qXnJRqck7kYOHEZ8RL5WeBjWygeyys3PK1p9rBhKvD3SydP/y3oiDKuuouJSvD3 kzBI08zlYQvCwfeDy14XuZj9PpDEeI47i+vvJ74+AHNapRrH9XdyO2ACemMmOGSbh38loS yDbwOOVhqrjk8q1KR4ISyO/7KKUIX0YTcrZpnJULdUdjg+AeJLfQn5uwWtwIOw== X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246096 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-in-check-for-font-lock-defaults.patch >From 23d172e17330e5c5d3403fdfacddedfbc91f5b90 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill 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 --=-=-=--