@end defun
@defun treesit-language-abi-version language
-This function returns the language grammar @acronym{ABI} version of
-language grammar for @var{language} loaded by Emacs. If
-@var{language} is unavailable, this function returns @code{nil}.
+This function returns the @acronym{ABI} version of the language
+grammar library loaded by Emacs for @var{language}. If @var{language}
+is unavailable, this function returns @code{nil}.
@end defun
@heading Concrete syntax tree
;;; Install & build language grammar
(defvar treesit-language-source-alist nil
- "Configures how to download tree-sitter language grammars.
-This should be an alist of
+ "Configuration for downloading and installing tree-sitter language grammars.
+
+The value should be an alist where each elemnt has the form
(LANG . (URL SOURCE-DIR GRAMMAR-DIR CC C++))
Only LANG and URL are mandatory. LANG is the language symbol.
-URL is the repository's url.
+URL is the Git repository URL for the grammar.
-SOURCE-DIR is the relative directory in the repository in which
-the grammar.c file resides, default to \"src\".
+SOURCE-DIR is the relative subdirectory in the repository in which
+the grammar's parser.c file resides, defaulting to \"src\".
-GRAMMAR-DIR is the relative grammar directory in the repository
-in which the grammar.js file resides, default to \"\".
+GRAMMAR-DIR is the relative subdirectory in the repository
+in which the grammar.js file resides, defaulting to \".\".
-CC and C++ are C and C++ compilers, default to \"cc\" and
+CC and C++ are C and C++ compilers, defaulting to \"cc\" and
\"c++\", respectively.")
(defun treesit-install-language-grammar (lang)
OUT-DIR is the directory to put the compiled library file. If it
is nil, the \"tree-sitter\" directory under user's Emacs
-configuration directory is used (and automatically created if not
-exist).
+configuration directory is used (and automatically created if it
+does not exist).
For LANG, URL, SOURCE-DIR, GRAMMAR-DIR, CC, C++, see
`treesit-language-source-alist'. If anything goes wrong, this
return lang;
}
-DEFUN ("treesit-language-available-p", Ftreesit_langauge_available_p,
+DEFUN ("treesit-language-available-p", Ftreesit_language_available_p,
Streesit_language_available_p,
1, 2, 0,
doc: /* Return non-nil if LANGUAGE exists and is loadable.
return make_fixnum (TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION);
}
-DEFUN ("treesit-language-version", Ftreesit_language_abi_version,
+DEFUN ("treesit-language-abi-version", Ftreesit_language_abi_version,
Streesit_language_abi_version,
0, 1, 0,
- doc: /* Return the language ABI version of the tree-sitter LANGUAGE.
-Return nil if LANGUAGE is not available. */)
+ doc: /* Return the ABI version of the tree-sitter grammar for LANGUAGE.
+Return nil if a grammar library for LANGUAGE is not available. */)
(Lisp_Object language)
{
- if (NILP (Ftreesit_langauge_available_p (language, Qnil)))
+ if (NILP (Ftreesit_language_available_p (language, Qnil)))
return Qnil;
else
{