emacs-devel
[Top][All Lists]
Advanced

[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.

reply via email to

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