emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call for volunteers: add tree-sitter support to major modes


From: Eli Zaretskii
Subject: Re: Call for volunteers: add tree-sitter support to major modes
Date: Mon, 10 Oct 2022 11:16:42 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 9 Oct 2022 23:46:27 -0700
> Cc: Theodor Thornhill <theo@thornhill.no>,
>  emacs-devel@gnu.org
> 
> > Automatically and silently?  I don't think so.  The user should know
> > the knob they pressed didn't work.
> 
> Not silently, print a message, raise a user-error at the end, but don’t fail 
> completely and leave the user in a broken mode. I suggest:
> 
> (define-derived-mode mode
>   (if (and use-tree-sitter tree-sitter-works)
>       init-tree-sitter
>     init-non-tree-sitter)
> 
>   (if (and use-tree-sitter (not tree-sitter-works))
>       ;; Or ‘message’.
>       (user-error "Tree-sitter can’t be enabled")))

Yes, this should leave the user with the original mode without
tree-sitter.

> If we think this is good, I’ll add it to the starter guide.

Please do, and thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]