[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: Average-user-facing interface for tree-sitter
From: |
Drew Adams |
Subject: |
RE: [External] : Re: Average-user-facing interface for tree-sitter |
Date: |
Wed, 19 Oct 2022 03:48:33 +0000 |
> That's why define-globalized-minor-mode has a TURN-ON function
> argument separately from the MODE argument: the TURN-ON function has
> to determine whether to enable the minor mode or not. It shouldn't
> blindly call `treesit-mode` but first check whether `treesit-mode`
> is applicable.
>
> This way, `treesit-mode` can always signal an error when called in
> a buffer where it's not applicable: it's always the responsibility of
> the caller to check beforehand.
FWIW, I think it wouldn't hurt to add this info to
the `define-globalized-minor-mode` doc. It makes
perfect sense when you hear it, but otherwise it's
not necessarily obvious.
We do say it: "[TURN-ON] should try to turn MODE on
if applicable for that buffer". Still, it's clearer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
the way you just pointed it out, somehow.
- Re: Average-user-facing interface for tree-sitter, (continued)
- Re: Average-user-facing interface for tree-sitter, Stefan Monnier, 2022/10/14
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/15
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/17
- Re: Average-user-facing interface for tree-sitter, Lars Ingebrigtsen, 2022/10/17
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/18
- Re: Average-user-facing interface for tree-sitter, Stefan Monnier, 2022/10/18
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/18
- Re: Average-user-facing interface for tree-sitter, Stefan Monnier, 2022/10/18
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/18
- Re: Average-user-facing interface for tree-sitter, Stefan Monnier, 2022/10/18
- RE: [External] : Re: Average-user-facing interface for tree-sitter,
Drew Adams <=
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/19
- Re: Average-user-facing interface for tree-sitter, Theodor Thornhill, 2022/10/19
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/19
- Re: Average-user-facing interface for tree-sitter, Theodor Thornhill, 2022/10/20
- Re: Average-user-facing interface for tree-sitter, Stefan Monnier, 2022/10/20
- Re: Average-user-facing interface for tree-sitter, Theodor Thornhill, 2022/10/20
- Re: Average-user-facing interface for tree-sitter, Theodor Thornhill, 2022/10/20
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/20
- Re: Average-user-facing interface for tree-sitter, Yuan Fu, 2022/10/21
- Re: Average-user-facing interface for tree-sitter, Stefan Monnier, 2022/10/21