emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 0b0eae0bf7: ; Improve documentation of 'treesit-language-source


From: Eli Zaretskii
Subject: emacs-29 0b0eae0bf7: ; Improve documentation of 'treesit-language-source-alist'
Date: Tue, 3 Jan 2023 08:13:15 -0500 (EST)

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

    ; Improve documentation of 'treesit-language-source-alist'
    
    * lisp/treesit.el (treesit--install-language-grammar-build-recipe)
    (treesit-install-language-grammar):  Doc fixes.
    (treesit-install-language-grammar): Autoload it.
    
    * etc/NEWS: Improve wording of the
    'treesit-install-language-grammar' documentation.
---
 etc/NEWS        | 13 ++++++-------
 lisp/treesit.el |  7 ++++++-
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index e679b904a6..38a8798507 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -63,18 +63,17 @@ the other shared libraries used by Emacs, or in the 
"tree-sitter"
 subdirectory of your 'user-emacs-directory', or in a directory
 mentioned in the variable 'treesit-extra-load-path'.
 
-Emacs provides a user command, 'treesit-install-language-grammar',
-that automates the building process.  A third-party major mode package
-could instruct its users to set 'treesit-language-source-alist'
-accordingly and use that command to download and compile the language
-grammar.  A user could also use that command directly and manually
-guide it through the process.
-
 You only need to install language grammar libraries required by the
 Emacs modes you will use, as Emacs loads these libraries only when the
 corresponding mode is turned on in some buffer for the first time in
 an Emacs session.
 
+Emacs provides a user command, 'treesit-install-language-grammar',
+that automates the download and build process of a grammar library.
+It prompts for the language, the URL of the language grammar's VCS
+repository, and then uses the installed C/C++ compiler to build the
+library and install it.
+
 +++
 ** Emacs can be built with built-in support for accessing SQLite databases.
 This uses the popular sqlite3 library, and can be disabled by using
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 1ca72af5c2..933d53082f 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2633,7 +2633,7 @@ CC and C++ are C and C++ compilers, defaulting to \"cc\" 
and
 \"c++\", respectively.")
 
 (defun treesit--install-language-grammar-build-recipe (lang)
-  "Interactively build a recipe for LANG and return it.
+  "Interactively produce a download/build recipe for LANG and return it.
 See `treesit-language-source-alist' for details."
   (when (y-or-n-p (format "There is no recipe for %s, do you want to build it 
interactively?" lang))
     (cl-labels ((empty-string-to-nil (string)
@@ -2655,9 +2655,14 @@ See `treesit-language-source-alist' for details."
         (read-string
          "Enter the C++ compiler to use (default: auto-detect): "))))))
 
+;;;###autoload
 (defun treesit-install-language-grammar (lang)
   "Build and install the tree-sitter language grammar library for LANG.
 
+Interactively, if `treesit-language-source-alist' doesn't already
+have data for building the grammar for LANG, prompt for its
+repository URL and the C/C++ compiler to use.
+
 This command requires Git, a C compiler and (sometimes) a C++ compiler,
 and the linker to be installed and on PATH.  It also requires that the
 recipe for LANG exists in `treesit-language-source-alist'.



reply via email to

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