Function: treesit-language-available-p
treesit-language-available-p is a function defined in treesit.c.
Signature
(treesit-language-available-p LANGUAGE &optional DETAIL)
Documentation
Return non-nil if LANGUAGE exists and is loadable.
If DETAIL is non-nil, return (t . nil) when LANGUAGE is available,
(nil . DATA) when unavailable. DATA is the signal data of
treesit-load-language-error.
Source Code
// Defined in /usr/src/emacs/src/treesit.c
{
CHECK_SYMBOL (language);
treesit_initialize ();
Lisp_Object signal_symbol = Qnil;
Lisp_Object signal_data = Qnil;
if (treesit_load_language (language, &signal_symbol, &signal_data) == NULL)
{
if (NILP (detail))
return Qnil;
else
return Fcons (Qnil, signal_data);
}
else
{
if (NILP (detail))
return Qt;
else
return Fcons (Qt, Qnil);
}
}