[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tree-sitter api
From: |
Stefan Monnier |
Subject: |
Re: Tree-sitter api |
Date: |
Fri, 17 Sep 2021 09:14:17 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> (defvar tree-sitter-major-mode-language-alist
> '((c-mode . c)
> ;; And other major modes that Emacs includes, or are well-known.
> (c++-mode . cpp)
> (javascript-mode . javascript)
> (python-mode . python))
> "Alist that maps major modes to tree-sitter language names.")
Why not just `tree-sitter-language-name` which the major mode can set
buffer-locally.
(setq-local tree-sitter-language-name 'foo)
is better than
(add-to-list 'tree-sitter-major-mode-language-alist '(foo-mode . foo))
[ Among other things because it won't signal an error when
`tree-sitter.el` is not loaded. ]
Stefan
- Re: Tree-sitter api, (continued)
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/15
- Re: Tree-sitter api, Stefan Monnier, 2021/09/15
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/15
- Re: Tree-sitter api, Yuan Fu, 2021/09/16
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/17
- Re: Tree-sitter api, Yuan Fu, 2021/09/17
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/17
- Re: Tree-sitter api, Yuan Fu, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api,
Stefan Monnier <=
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api, Stefan Monnier, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api, Stefan Monnier, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/04
Re: Tree-sitter api, Yuan Fu, 2021/09/04
Re: Tree-sitter api, Theodor Thornhill, 2021/09/05