emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 bfdad6c4e5: ; Fix recent treesit-related changes


From: Eli Zaretskii
Subject: emacs-29 bfdad6c4e5: ; Fix recent treesit-related changes
Date: Sat, 31 Dec 2022 03:13:58 -0500 (EST)

branch: emacs-29
commit bfdad6c4e5ce95025f1761a404b762589d126505
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; Fix recent treesit-related changes
    
    * lisp/treesit.el (treesit-language-source-alist)
    (treesit--install-language-grammar-1): Doc fixes.
    
    * src/treesit.c (Ftreesit_language_abi_version): Fix a typo in
    function's Lisp name.  Doc fix.
    (Ftreesit_language_available_p): Fix a typo in the function's C
    name.
    
    * doc/lispref/parsing.texi (Language Grammar): Fix wording.
---
 doc/lispref/parsing.texi |  6 +++---
 lisp/treesit.el          | 21 +++++++++++----------
 src/treesit.c            | 10 +++++-----
 3 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index 8803991b72..aaf9d7060a 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -154,9 +154,9 @@ them.
 @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
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 56f9b681e8..5c3b68ea87 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2615,21 +2615,22 @@ window."
 ;;; 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)
@@ -2687,8 +2688,8 @@ content as signal data, and erase buffer afterwards."
 
 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
diff --git a/src/treesit.c b/src/treesit.c
index 974d2fc451..e87bfc3429 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -632,7 +632,7 @@ treesit_load_language (Lisp_Object language_symbol,
   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.
@@ -679,14 +679,14 @@ is non-nil, return the oldest compatible ABI version.  */)
     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
     {



reply via email to

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