* bug#58755: 29.0.50; Font locking not enabling for ts-mode
@ 2022-10-24 6:43 Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-24 7:15 ` Yuan Fu
0 siblings, 1 reply; 4+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-24 6:43 UTC (permalink / raw)
To: 58755
[-- Attachment #1: Type: text/plain, Size: 267 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-in-check-for-font-lock-defaults.patch --]
[-- Type: text/x-diff, Size: 988 bytes --]
From 23d172e17330e5c5d3403fdfacddedfbc91f5b90 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#58755: 29.0.50; Font locking not enabling for ts-mode
2022-10-24 6:43 bug#58755: 29.0.50; Font locking not enabling for ts-mode Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-24 7:15 ` Yuan Fu
2022-10-24 7:29 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Yuan Fu @ 2022-10-24 7:15 UTC (permalink / raw)
To: Theodor Thornhill; +Cc: 58755
> On Oct 23, 2022, at 11:43 PM, Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
>
> 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
Hey Theo, sorry for the trouble… Yeah font-lock-mode looks at font-lock-default’s value when turning on and won’t do anything if it’s value is nil. I thought we are going to install a new scheme soon so I didn’t change the code. I’ll fix ts-mode and push.
Yuan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#58755: 29.0.50; Font locking not enabling for ts-mode
2022-10-24 7:15 ` Yuan Fu
@ 2022-10-24 7:29 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-24 20:16 ` Yuan Fu
0 siblings, 1 reply; 4+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-24 7:29 UTC (permalink / raw)
To: Yuan Fu; +Cc: 58755
Yuan Fu <casouri@gmail.com> writes:
>> On Oct 23, 2022, at 11:43 PM, Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
>>
>> 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
>
> Hey Theo, sorry for the trouble… Yeah font-lock-mode looks at font-lock-default’s value when turning on and won’t do anything if it’s value is nil. I thought we are going to install a new scheme soon so I didn’t change the code. I’ll fix ts-mode and push.
>
No worries. Did we decide upon something there?
Theo
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#58755: 29.0.50; Font locking not enabling for ts-mode
2022-10-24 7:29 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-24 20:16 ` Yuan Fu
0 siblings, 0 replies; 4+ messages in thread
From: Yuan Fu @ 2022-10-24 20:16 UTC (permalink / raw)
To: Theodor Thornhill; +Cc: 58755
> On Oct 24, 2022, at 12:29 AM, Theodor Thornhill <theo@thornhill.no> wrote:
>
> Yuan Fu <casouri@gmail.com> writes:
>
>>> On Oct 23, 2022, at 11:43 PM, Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
>>>
>>> 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
>>
>> Hey Theo, sorry for the trouble… Yeah font-lock-mode looks at font-lock-default’s value when turning on and won’t do anything if it’s value is nil. I thought we are going to install a new scheme soon so I didn’t change the code. I’ll fix ts-mode and push.
>>
>
> No worries. Did we decide upon something there?
>
> Theo
No, not yet. I still think a central variable has more merits and less problems than minor modes as they are now. We’ll need discussion and more good ideas :-)
Yuan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-24 20:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24 6:43 bug#58755: 29.0.50; Font locking not enabling for ts-mode Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-24 7:15 ` Yuan Fu
2022-10-24 7:29 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-24 20:16 ` Yuan Fu
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.