aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-12-18 12:08:22 +0200
committerEli Zaretskii2022-12-18 12:08:22 +0200
commit88e59b16cbe293f480e7d142dd3c8cb01e7ff225 (patch)
tree1648597c685bfa1d409a68b657f5bb493caa865e
parent897f33bf316dd95107377c7bc7a9162482abcc4c (diff)
downloademacs-88e59b16cbe293f480e7d142dd3c8cb01e7ff225.tar.gz
emacs-88e59b16cbe293f480e7d142dd3c8cb01e7ff225.zip
; Improve documentation of installing tree-sitter and grammars.
* etc/NEWS: Enhance tree-sitter sections wrt grammar libraries.
-rw-r--r--etc/NEWS51
1 files changed, 51 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d4f96b26f75..25148dc2fdc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -40,6 +40,34 @@ modes, described elsewhere in this file, that are based on the
40installed, the configure script will automatically include it in the 40installed, the configure script will automatically include it in the
41build; use '--without-tree-sitter' at configure time to disable that. 41build; use '--without-tree-sitter' at configure time to disable that.
42 42
43Emacs modes based on the tree-sitter library require an additional
44grammar library for each mode. These grammar libraries provide the
45tree-sitter library with language-specific lexical analysis and
46parsing capabilities, and are developed separately from the
47tree-sitter library itself. If you don't have a grammar library
48required by some Emacs major mode, and your distro doesn't provide it
49as an installable package, you can compile and install such a library
50yourself. Many libraries can be downloaded from the tree-sitter site:
51
52 https://github.com/tree-sitter
53
54To compile such a library, compile the files scanner.c and parser.c
55(sometimes named scanner.cc and parser.cc) in the 'src' subdirectory
56of the library's source tree using the C or C++ compiler, then link
57these two files into a shared library named 'libtree-sitter-LANG.so',
58where LANG is the name of the language supported by the grammar as it
59is expected by the Emacs major mode (for example, "c" for c-ts-mode,
60"cpp" for c++-ts-mode, "python" for python-ts-mode, etc.). Then place
61the shared library you've built in the same directory where you keep
62the other shared libraries used by Emacs, or in the 'tree-sitter'
63subdirectory of your 'user-emacs-directory', or in a directory
64mentioned in the variable 'treesit-extra-load-path'.
65
66You only need to install language grammar libraries required by the
67Emacs modes you will use, as Emacs loads these libraries only when the
68corresponding mode is turned on in some buffer for the first time in
69an Emacs session.
70
43+++ 71+++
44** Emacs can be built with built-in support for accessing SQLite databases. 72** Emacs can be built with built-in support for accessing SQLite databases.
45This uses the popular sqlite3 library, and can be disabled by using 73This uses the popular sqlite3 library, and can be disabled by using
@@ -3028,6 +3056,29 @@ indentation, and navigation by defuns based on parsing the buffer text
3028by a tree-sitter parser. Some major modes also offer support for 3056by a tree-sitter parser. Some major modes also offer support for
3029Imenu and 'which-func'. 3057Imenu and 'which-func'.
3030 3058
3059Where major modes already exist in Emacs for editing certain kinds of
3060files, the new modes based on tree-sitter are for now entirely
3061optional, and you must turn them on manually, or customize
3062'auto-mode-alist' to turn them on automatically.
3063
3064Each major mode based on tree-sitter needs a language grammar library,
3065usually named 'libtree-sitter-LANG.so' ('libtree-sitter-LANG.dll' on
3066MS-Windows), where LANG is the corresponding language name. Emacs
3067looks for these libraries in the following places:
3068
3069 . in the directories mentioned in the list 'treesit-extra-load-path'
3070 . in the 'tree-sitter' subdirectory of your 'user-emacs-directory'
3071 (by default, '~/.emacs.d/tree-sitter')
3072 . in the standard system directories where other shared libraries are
3073 usually installed
3074
3075We recommend to install these libraries in one of the standard system
3076locations (the last place in the above list).
3077
3078If a language grammar library required by a mode is not found in any
3079of the above places, the mode will signal an error when you try to
3080turn it on.
3081
3031*** New major mode 'typescript-ts-mode'. 3082*** New major mode 'typescript-ts-mode'.
3032A major mode based on the tree-sitter library for editing programs 3083A major mode based on the tree-sitter library for editing programs
3033in the TypeScript language. This mode is auto-enabled for files with 3084in the TypeScript language. This mode is auto-enabled for files with