diff options
| author | Eli Zaretskii | 2023-01-19 20:13:54 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-01-19 20:13:54 +0200 |
| commit | 78b83a744fa28abb3bb631e2688c19bd68896425 (patch) | |
| tree | 9f1b0ed326320cd6d26eb0c4a82569221005bc54 | |
| parent | fb82d4e3286935286b51765c4823f290428f25aa (diff) | |
| download | emacs-78b83a744fa28abb3bb631e2688c19bd68896425.tar.gz emacs-78b83a744fa28abb3bb631e2688c19bd68896425.zip | |
; * etc/NEWS: Rearrange instructions for building tree-sitter grammars.
| -rw-r--r-- | etc/NEWS | 36 |
1 files changed, 19 insertions, 17 deletions
| @@ -53,29 +53,31 @@ yourself. Many libraries can be downloaded from the tree-sitter site: | |||
| 53 | 53 | ||
| 54 | https://github.com/tree-sitter | 54 | https://github.com/tree-sitter |
| 55 | 55 | ||
| 56 | To compile such a library, compile the files "scanner.c" and "parser.c" | ||
| 57 | (sometimes named "scanner.cc" and "parser.cc") in the "src" subdirectory | ||
| 58 | of the library's source tree using the C or C++ compiler, then link | ||
| 59 | these two files into a shared library named "libtree-sitter-LANG.so", | ||
| 60 | where LANG is the name of the language supported by the grammar as it | ||
| 61 | is expected by the Emacs major mode (for example, "c" for 'c-ts-mode', | ||
| 62 | "cpp" for 'c++-ts-mode', "python" for 'python-ts-mode', etc.). Then place | ||
| 63 | the shared library you've built in the same directory where you keep | ||
| 64 | the other shared libraries used by Emacs, or in the "tree-sitter" | ||
| 65 | subdirectory of your 'user-emacs-directory', or in a directory | ||
| 66 | mentioned in the variable 'treesit-extra-load-path'. | ||
| 67 | |||
| 68 | You only need to install language grammar libraries required by the | ||
| 69 | Emacs modes you will use, as Emacs loads these libraries only when the | ||
| 70 | corresponding mode is turned on in some buffer for the first time in | ||
| 71 | an Emacs session. | ||
| 72 | |||
| 73 | Emacs provides a user command, 'treesit-install-language-grammar', | 56 | Emacs provides a user command, 'treesit-install-language-grammar', |
| 74 | that automates the download and build process of a grammar library. | 57 | that automates the download and build process of a grammar library. |
| 75 | It prompts for the language, the URL of the language grammar's VCS | 58 | It prompts for the language, the URL of the language grammar's VCS |
| 76 | repository, and then uses the installed C/C++ compiler to build the | 59 | repository, and then uses the installed C/C++ compiler to build the |
| 77 | library and install it. | 60 | library and install it. |
| 78 | 61 | ||
| 62 | You can also do this manually. To compile such a library after | ||
| 63 | cloning its Git repository, compile the files "scanner.c" and | ||
| 64 | "parser.c" (sometimes named "scanner.cc" and "parser.cc") in the "src" | ||
| 65 | subdirectory of the library's source tree using the C or C++ compiler, | ||
| 66 | then link these two files into a shared library named | ||
| 67 | "libtree-sitter-LANG.so", where LANG is the name of the language | ||
| 68 | supported by the grammar as it is expected by the Emacs major mode | ||
| 69 | (for example, "c" for 'c-ts-mode', "cpp" for 'c++-ts-mode', "python" | ||
| 70 | for 'python-ts-mode', etc.). Then place the shared library you've | ||
| 71 | built in the same directory where you keep the other shared libraries | ||
| 72 | used by Emacs, or in the "tree-sitter" subdirectory of your | ||
| 73 | 'user-emacs-directory', or in a directory mentioned in the variable | ||
| 74 | 'treesit-extra-load-path'. | ||
| 75 | |||
| 76 | You only need to install language grammar libraries required by the | ||
| 77 | Emacs modes you will use, as Emacs loads these libraries only when the | ||
| 78 | corresponding mode is turned on in some buffer for the first time in | ||
| 79 | an Emacs session. | ||
| 80 | |||
| 79 | +++ | 81 | +++ |
| 80 | ** Emacs can be built with built-in support for accessing SQLite databases. | 82 | ** Emacs can be built with built-in support for accessing SQLite databases. |
| 81 | This uses the popular sqlite3 library, and can be disabled by using | 83 | This uses the popular sqlite3 library, and can be disabled by using |