Commit 0805972e authored by Stefan Kangas's avatar Stefan Kangas
Browse files

Merge from origin/emacs-29

b3de81a6 MH-E: handle removal of mhparam libdir from nmh 1.8
d63e1a89 Use point-min to anchor top-level constructs (bug#60602)
34793337 * lisp/org/ob-ruby.el: Fix outdated comments.
472f1425 ; ruby-ts-mode: Add a Version tag
0cf05364 ; ruby-ts-mode: Update font-lock features list in Commentary
67ee627c (project-try-vc): Add string-start and string-end anchors...
06953fc8 Make `keymap-set-after' work for menus
dcd59457 Use `key-parse' in `keymap-lookup'
8904a26a Improve `keymap-set-after' documentation
c7e02eaa Handle after arg correctly in `keymap-set-after'
628b6241 Don't load erc-goodies atop erc.el
40cf494b ; * etc/NEWS: Fix typos.
6b2f85ca Make tree-sitter based modes optional
b56cf28b ; (ruby-ts--predefined-variables): Make it a little shorter
d94dc606 ruby-ts-mode: Claw back half of the performance drop from...
d0d34514 (ruby-ts-mode): Rename 'builtin-functions' to 'builtin-fu...
d66ac528 ruby-ts-mode: Highlight builtin methods
370b1ac9 ; ruby-ts-mode.el: Add customize-group mention to commentary
7b7b2b95 Fix c-ts-mode indent (bug#60873)
7ca71d66 Fix various problems in treesit-explore-mode (bug#60800)
b7d6bb47 ; * lisp/treesit.el (treesit-font-lock-fontify-region): M...
0c6bfedd ; Update tree-sitter major mode manual
c2897868 ; Add commentary and dostring in c-ts-mode

# Conflicts:
#	etc/NEWS
#	lisp/progmodes/c-ts-mode.el
#	lisp/progmodes/go-ts-mode.el
parents 8febda46 b3de81a6
......@@ -1378,7 +1378,8 @@ Binding Conventions}).
or if @var{key} is not a valid key.
@var{key} is a string representing a single key or a series of key
strokes. Key strokes are separated by a single space character.
strokes, and must satisfy @code{key-valid-p}. Key strokes are
separated by a single space character.
Each key stroke is either a single character, or the name of an
event, surrounded by angle brackets. In addition, any key stroke
......@@ -1413,6 +1414,7 @@ The only keys that have a special shorthand syntax are @kbd{NUL},
The modifiers have to be specified in alphabetical order:
@samp{A-C-H-M-S-s}, which is @samp{Alt-Control-Hyper-Meta-Shift-super}.
@findex keymap-set
@defun keymap-set keymap key binding
This function sets the binding for @var{key} in @var{keymap}. (If
@var{key} is more than one event long, the change is actually made
......@@ -3079,13 +3081,13 @@ the menu. To put it elsewhere in the menu, use @code{keymap-set-after}:
@defun keymap-set-after map key binding &optional after
Define a binding in @var{map} for @var{key}, with value @var{binding},
just like @code{define-key}, but position the binding in @var{map} after
the binding for the event @var{after}. The argument @var{key} should be
of length one---a vector or string with just one element. But
@var{after} should be a single event type---a symbol or a character, not
a sequence. The new binding goes after the binding for @var{after}. If
@var{after} is @code{t} or is omitted, then the new binding goes last, at
the end of the keymap. However, new bindings are added before any
inherited keymap.
the binding for the event @var{after}. The argument @var{key} should
represent a single menu item or key, and @var{after} should be a
single event type---a symbol or a character, not a sequence. The new
binding goes after the binding for @var{after}. If @var{after} is
@code{t} or is omitted, then the new binding goes last, at the end of
the keymap. However, new bindings are added before any inherited
keymap.
Here is an example:
......
......@@ -1692,26 +1692,48 @@ integration for a major mode.
A major mode supporting tree-sitter features should roughly follow
this pattern:
@c FIXME: Update this part once we settle on the exact format.
@example
@group
(define-derived-mode woomy-mode prog-mode "Woomy"
"A mode for Woomy programming language."
;; Shared setup.
...
(cond
;; Tree-sitter setup.
((treesit-ready-p 'woomy)
(when (treesit-ready-p 'woomy)
(setq-local treesit-variables ...)
(treesit-major-mode-setup))
;; Non-tree-sitter setup.
(t
...)))
...
(treesit-major-mode-setup)))
@end group
@end example
First, the major mode should use @code{treesit-ready-p} to determine
whether tree-sitter can be activated in this mode.
@code{treesit-ready-p} automatically emits a warning if conditions for
enabling tree-sitter aren't met.
If a tree-sitter major mode shares setup with their ``native''
counterpart, they can create a ``base mode'' that contains the common
setup, like this:
@example
@group
(define-derived-mode woomy--base-mode prog-mode "Woomy"
"An internal mode for Woomy programming language."
(common-setup)
...)
@end group
@group
(define-derived-mode woomy-mode woomy--base-mode "Woomy"
"A mode for Woomy programming language."
(native-setup)
...)
@end group
@group
(define-derived-mode woomy-ts-mode woomy--base-mode "Woomy"
"A mode for Woomy programming language."
(when (treesit-ready-p 'woomy)
(setq-local treesit-variables ...)
...
(treesit-major-mode-setup)))
@end group
@end example
@defun treesit-ready-p language &optional quiet
This function checks for conditions for activating tree-sitter. It
......@@ -1722,15 +1744,12 @@ language grammar for @var{language} is available on the system
This function emits a warning if tree-sitter cannot be activated. If
@var{quiet} is @code{message}, the warning is turned into a message;
if @var{quiet} is @code{nil}, no warning or message is displayed.
if @var{quiet} is @code{t}, no warning or message is displayed.
If all the necessary conditions are met, this function returns
non-@code{nil}; otherwise it returns @code{nil}.
@end defun
Next, the major mode should set up tree-sitter variables and call
@code{treesit-major-mode-setup}.
@defun treesit-major-mode-setup
This function activates some tree-sitter features for a major mode.
......
......@@ -34,13 +34,14 @@ This feature existed in Emacs 28.1, but was less easy to request.
+++
** Emacs can be built with the tree-sitter parsing library.
This library, together with grammar libraries, provides incremental
parsing capabilities for several popular programming languages and
other formatted files. Emacs built with this library offers major
modes, described elsewhere in this file, that are based on the
tree-sitter's parsers. If you have the tree-sitter library
installed, the configure script will automatically include it in the
build; use '--without-tree-sitter' at configure time to disable that.
This library, together with separate grammar libraries for each
language, provides incremental parsing capabilities for several
popular programming languages and other formatted files. Emacs built
with this library offers major modes, described elsewhere in this
file, that are based on the tree-sitter's parsers. If you have the
tree-sitter library installed, the configure script will automatically
include it in the build; use '--without-tree-sitter' at configure time
to disable that.
Emacs modes based on the tree-sitter library require an additional
grammar library for each mode. These grammar libraries provide the
......@@ -3183,19 +3184,19 @@ indentation, and navigation by defuns based on parsing the buffer text
by a tree-sitter parser. Some major modes also offer support for
Imenu and 'which-func'.
Where major modes already exist in Emacs for editing certain kinds of
files, the new modes based on tree-sitter are for now entirely
optional, and you must turn them on manually, or customize
'auto-mode-alist' to turn them on automatically.
The new modes based on tree-sitter are for now entirely optional, and
you must turn them on manually, or load them in your init file, or
customize 'auto-mode-alist' to turn them on automatically for certain
files. You can also customize 'major-mode-remap-alist' to
automatically turn on some tree-sitter based modes for the same files
for which a "built-in" mode would be turned on. For example:
Where no major modes previously existed in Emacs for editing the kinds
of files for which Emacs now provides a tree-sitter based mode, Emacs
will now try to enable these new modes automatically when you visit
such files, and will display a warning if the tree-sitter library or
the parser grammar library is not available. To prevent the warnings,
either build Emacs with tree-sitter and install the grammar libraries,
or customize 'auto-mode-alist' to specify some other major mode (or
even 'fundamental-mode') for those kinds of files.
(add-to-list 'major-mode-remap-alist '(ruby-mode . ruby-ts-mode))
If you try these modes and don't like them, you can go back to the
"built-in" modes by restarting Emacs. But please tell us why you
didn't like the tree-sitter based modes, so that we could try
improving them.
Each major mode based on tree-sitter needs a language grammar library,
usually named "libtree-sitter-LANG.so" ("libtree-sitter-LANG.dll" on
......@@ -3212,20 +3213,18 @@ We recommend to install these libraries in one of the standard system
locations (the last place in the above list).
If a language grammar library required by a mode is not found in any
of the above places, the mode will signal an error when you try to
of the above places, the mode will display a warning when you try to
turn it on.
+++
*** New major mode 'typescript-ts-mode'.
A major mode based on the tree-sitter library for editing programs
in the TypeScript language. This mode is auto-enabled for files with
the ".ts" extension.
in the TypeScript language.
+++
*** New major mode 'tsx-ts-mode'.
A major mode based on the tree-sitter library for editing programs
in the TypeScript language, with support for TSX. This mode is
auto-enabled for files with the ".tsx" extension.
in the TypeScript language, with support for TSX.
+++
*** New major mode 'c-ts-mode'.
......@@ -3275,15 +3274,11 @@ Bash shell scripts.
+++
*** New major mode 'dockerfile-ts-mode'.
A major mode based on the tree-sitter library for editing
Dockerfiles. This mode is auto-enabled for files which are named
"Dockerfile", have the "Dockerfile." prefix, or have the ".dockerfile"
extension.
Dockerfiles.
+++
*** New major mode 'cmake-ts-mode'.
A major mode based on the tree-sitter library for editing CMake files.
It is auto-enabled for files whose name is "CMakeLists.txt" or whose
extension is ".cmake".
+++
*** New major mode 'toml-ts-mode'.
......@@ -3293,23 +3288,22 @@ files written in TOML, a format for writing configuration files.
+++
*** New major mode 'go-ts-mode'.
A major mode based on the tree-sitter library for editing programs in
the Go language. It is auto-enabled for files with the ".go" extension.
the Go language.
+++
*** New major mode 'go-mod-ts-mode'.
A major mode based on the tree-sitter library for editing "go.mod"
files. It is auto-enabled for files which are named "go.mod".
files.
+++
*** New major mode 'yaml-ts-mode'.
A major mode based on the tree-sitter library for editing files
written in YAML. It is auto-enabled for files with the ".yaml" or
".yml" extensions.
written in YAML.
+++
*** New major mode 'rust-ts-mode'.
A major mode based on the tree-sitter library for editing programs in
the Rust language. It is auto-enabled for files with the ".rs" extension.
the Rust language.
---
*** New major mode 'ruby-ts-mode'.
......
......@@ -61,7 +61,6 @@
(load "erc-loaddefs" 'noerror 'nomessage)
(require 'erc-networks)
(require 'erc-goodies)
(require 'erc-backend)
(require 'cl-lib)
(require 'format-spec)
......@@ -7386,4 +7385,6 @@ Customize `erc-url-connect-function' to override this."
(provide 'erc)
;; FIXME this is a temporary stopgap for Emacs 29.
(require 'erc-goodies)
;;; erc.el ends here
......@@ -186,10 +186,17 @@ a menu, so this function is not useful for non-menu keymaps."
(declare (indent defun)
(compiler-macro (lambda (form) (keymap--compile-check key) form)))
(keymap--check key)
(when after
(keymap--check after))
(when (eq after t) (setq after nil)) ; nil and t are treated the same
(when (stringp after)
(keymap--check after)
(setq after (key-parse after)))
;; If we're binding this key to another key, then parse that other
;; key, too.
(when (stringp definition)
(keymap--check definition)
(setq definition (key-parse definition)))
(define-key-after keymap (key-parse key) definition
(and after (key-parse after))))
after))
(defun key-parse (keys)
"Convert KEYS to the internal Emacs key representation.
......@@ -404,7 +411,7 @@ specified buffer position instead of point are used."
(symbolp value))
(or (command-remapping value) value)
value))
(key-binding (kbd key) accept-default no-remap position)))
(key-binding (key-parse key) accept-default no-remap position)))
(defun keymap-local-lookup (keys &optional accept-default)
"Return the binding for command KEYS in current local keymap only.
......
......@@ -764,6 +764,8 @@ This assumes that a temporary buffer is set up."
;; Sample '-version' outputs:
;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003]
;; install-mh -- nmh-1.7.1 built October 26, 2019 on build-server-000
;; "libdir" was deprecated in nmh-1.7 in favor of "libexecdir", and
;; removed completely in nmh-1.8.
(let ((install-mh (expand-file-name "install-mh" dir)))
(when (mh-file-command-p install-mh)
(erase-buffer)
......@@ -774,7 +776,8 @@ This assumes that a temporary buffer is set up."
(mh-progs dir))
`(,version
(variant nmh)
(mh-lib-progs ,(mh-profile-component "libdir"))
(mh-lib-progs ,(or (mh-profile-component "libdir")
(mh-profile-component "libexecdir")))
(mh-lib ,(mh-profile-component "etcdir"))
(mh-progs ,dir)
(flists ,(file-exists-p
......
......@@ -29,11 +29,10 @@
;; - ruby and irb executables :: https://www.ruby-lang.org/
;;
;; - ruby-mode :: Can be installed through ELPA, or from
;; https://github.com/eschulte/rinari/raw/master/util/ruby-mode.el
;; - ruby-mode :: Comes with Emacs.
;;
;; - inf-ruby mode :: Can be installed through ELPA, or from
;; https://github.com/eschulte/rinari/raw/master/util/inf-ruby.el
;; https://raw.githubusercontent.com/nonsequitur/inf-ruby/master/inf-ruby.el
;;; Code:
......
......@@ -24,6 +24,58 @@
;;; Commentary:
;;
;; This package provides major modes for C and C++, plus some handy
;; functions that are useful generally to major modes for C-like
;; languages.
;;
;; This package provides `c-ts-mode' for C, `c++-ts-mode' for C++, and
;; `c-or-c++-ts-mode' which automatically chooses the right mode for
;; C/C++ header files.
;;
;; To use these modes by default, assuming you have the respective
;; tree-sitter grammars available, do one of the following:
;;
;; - If you have both C and C++ grammars installed, add
;;
;; (require 'c-ts-mode)
;;
;; to your init file.
;;
;; - Add one or mode of the following to your init file:
;;
;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
;; (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode))
;; (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode))
;;
;; If you have only C grammar available, use only the first one; if
;; you have only the C++ grammar, use only the second one.
;;
;; - Customize 'auto-mode-alist' to turn one or more of the modes
;; automatically. For example:
;;
;; (add-to-list 'auto-mode-alist
;; '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'"
;; . c++-ts-mode))
;;
;; will turn on the c++-ts-mode for C++ source files.
;;
;; You can also turn on these modes manually in a buffer. Doing so
;; will set up Emacs to use the C/C++ modes defined here for other
;; files, provided that you have the corresponding parser grammar
;; libraries installed.
;;
;; For C-like language major modes:
;;
;; - Use `c-ts-mode-comment-setup' to setup comment variables and
;; filling.
;;
;; - Use simple-indent matcher `c-ts-mode--looking-at-star' and anchor
;; `c-ts-mode--comment-start-after-first-star' for indenting block
;; comments. See `c-ts-mode--indent-styles' for example.
;;
;; - Use variable `c-ts-mode-indent-block-type-regexp' with indent
;; offset c-ts-mode--statement-offset for indenting statements.
;; Again, see `c-ts-mode--indent-styles' for example.
;;; Code:
......@@ -115,7 +167,7 @@ delimiters < and >'s."
"Indent rules supported by `c-ts-mode'.
MODE is either `c' or `cpp'."
(let ((common
`(((parent-is "translation_unit") parent-bol 0)
`(((parent-is "translation_unit") point-min 0)
((node-is ")") parent 1)
((node-is "]") parent-bol 0)
((node-is "else") parent-bol 0)
......@@ -257,7 +309,18 @@ PARENT is NODE's parent."
(cl-incf level)
(save-excursion
(goto-char (treesit-node-start node))
(cond ((bolp) nil)
;; Add an extra level if the opening bracket is on its own
;; line, except (1) it's at top-level, or (2) it's immedate
;; parent is another block.
(cond ((bolp) nil) ; Case (1).
((let ((parent-type (treesit-node-type
(treesit-node-parent node))))
;; Case (2).
(and parent-type
(string-match-p c-ts-mode-indent-block-type-regexp
parent-type)))
nil)
;; Add a level.
((looking-back (rx bol (* whitespace))
(line-beginning-position))
(cl-incf level))))))
......@@ -967,7 +1030,16 @@ Set up:
This mode is independent from the classic cc-mode.el based
`c-mode', so configuration variables of that mode, like
`c-basic-offset', don't affect this mode."
`c-basic-offset', doesn't affect this mode.
To use tree-sitter C/C++ modes by default, evaluate
(add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode))
(add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode))
(add-to-list \\='major-mode-remap-alist
\\='(c-or-c++-mode . c-or-c++-ts-mode))
in your configuration."
:group 'c
(when (treesit-ready-p 'c)
......@@ -984,7 +1056,20 @@ This mode is independent from the classic cc-mode.el based
;;;###autoload
(define-derived-mode c++-ts-mode c-ts-base-mode "C++"
"Major mode for editing C++, powered by tree-sitter."
"Major mode for editing C++, powered by tree-sitter.
This mode is independent from the classic cc-mode.el based
`c++-mode', so configuration variables of that mode, like
`c-basic-offset', don't affect this mode.
To use tree-sitter C/C++ modes by default, evaluate
(add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode))
(add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode))
(add-to-list \\='major-mode-remap-alist
\\='(c-or-c++-mode . c-or-c++-ts-mode))
in your configuration."
:group 'c++
(when (treesit-ready-p 'cpp)
......@@ -1050,6 +1135,22 @@ the code is C or C++ and based on that chooses whether to enable
(re-search-forward c-ts-mode--c-or-c++-regexp nil t))))
(c++-ts-mode)
(c-ts-mode)))
;; The entries for C++ must come first to prevent *.c files be taken
;; as C++ on case-insensitive filesystems, since *.C files are C++,
;; not C.
(if (treesit-ready-p 'cpp)
(add-to-list 'auto-mode-alist
'("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'"
. c++-ts-mode)))
(if (treesit-ready-p 'c)
(add-to-list 'auto-mode-alist
'("\\(\\.[chi]\\|\\.lex\\|\\.y\\(acc\\)?\\|\\.x[bp]m\\)\\'"
. c-ts-mode)))
(if (and (treesit-ready-p 'cpp)
(treesit-ready-p 'c))
(add-to-list 'auto-mode-alist '("\\.h\\'" . c-or-c++-ts-mode)))
(provide 'c-ts-mode)
......
......@@ -194,10 +194,6 @@ the subtrees."
(t
`((,name . ,marker))))))
;;;###autoload
(add-to-list 'auto-mode-alist
'("\\(?:CMakeLists\\.txt\\|\\.cmake\\)\\'" . cmake-ts-mode))
;;;###autoload
(define-derived-mode cmake-ts-mode prog-mode "CMake"
"Major mode for editing CMake files, powered by tree-sitter."
......@@ -229,6 +225,10 @@ the subtrees."
(treesit-major-mode-setup)))
(if (treesit-ready-p 'cmake)
(add-to-list 'auto-mode-alist
'("\\(?:CMakeLists\\.txt\\|\\.cmake\\)\\'" . cmake-ts-mode)))
(provide 'cmake-ts-mode)
;;; cmake-ts-mode.el ends here
......@@ -883,9 +883,6 @@ Return nil if there is no name or if NODE is not a defun node."
node "name")
t))))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-mode))
;;;###autoload
(define-derived-mode csharp-mode prog-mode "C#"
"Major mode for editing Csharp code.
......@@ -946,7 +943,9 @@ Key bindings:
("Struct" "\\`struct_declaration\\'" nil nil)
("Method" "\\`method_declaration\\'" nil nil)))
(treesit-major-mode-setup))
(treesit-major-mode-setup)
(add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-ts-mode)))
(provide 'csharp-mode)
......
......@@ -132,12 +132,6 @@ the subtrees."
(t
`((,name . ,marker))))))
;;;###autoload
(add-to-list 'auto-mode-alist
;; NOTE: We can't use `rx' here, as it breaks bootstrap.
'("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'"
. dockerfile-ts-mode))
;;;###autoload
(define-derived-mode dockerfile-ts-mode prog-mode "Dockerfile"
"Major mode for editing Dockerfiles, powered by tree-sitter."
......@@ -176,6 +170,12 @@ the subtrees."
(treesit-major-mode-setup)))
(if (treesit-ready-p 'dockerfile)
(add-to-list 'auto-mode-alist
;; NOTE: We can't use `rx' here, as it breaks bootstrap.
'("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'"
. dockerfile-ts-mode)))
(provide 'dockerfile-ts-mode)
;;; dockerfile-ts-mode.el ends here
......@@ -174,9 +174,6 @@
'((ERROR) @font-lock-warning-face))
"Tree-sitter font-lock settings for `go-ts-mode'.")
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode))
(defvar-keymap go-ts-mode-map
:doc "Keymap used in Go mode, powered by tree-sitter"
:parent prog-mode-map
......@@ -233,6 +230,9 @@
(treesit-major-mode-setup)))
(if (treesit-ready-p 'go)
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode)))
(defun go-ts-mode--defun-name (node)
"Return the defun name of NODE.
Return nil if there is no name or if NODE is not a defun node."
......@@ -378,9 +378,6 @@ what the parent of the node would be if it were a node."
'((ERROR) @font-lock-warning-face))
"Tree-sitter font-lock settings for `go-mod-ts-mode'.")
;;;###autoload
(add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode))
;;;###autoload
(define-derived-mode go-mod-ts-mode prog-mode "Go Mod"
"Major mode for editing go.mod files, powered by tree-sitter."
......@@ -409,6 +406,9 @@ what the parent of the node would be if it were a node."
(treesit-major-mode-setup)))
(if (treesit-ready-p 'gomod)
(add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode)))
(provide 'go-ts-mode)
;;; go-ts-mode.el ends here
......@@ -69,7 +69,7 @@
(defvar java-ts-mode--indent-rules
`((java
((parent-is "program") parent-bol 0)
((parent-is "program") point-min 0)
((node-is "}") (and parent parent-bol) 0)
((node-is ")") parent-bol 0)
((node-is "]") parent-bol 0)
......@@ -359,6 +359,9 @@ Return nil if there is no name or if NODE is not a defun node."
("Method" "\\`method_declaration\\'" nil nil)))
(treesit-major-mode-setup))
(if (treesit-ready-p 'java)
(add-to-list 'auto-mode-alist '("\\.java\\'" . java-ts-mode)))
(provide 'java-ts-mode)
;;; java-ts-mode.el ends here
......@@ -3903,7 +3903,10 @@ See `treesit-sexp-type-regexp' for more information.")
"method_definition")
eos)
nil nil)))
(treesit-major-mode-setup)))
(treesit-major-mode-setup)
(add-to-list 'auto-mode-alist
'("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))))
;;;###autoload
(define-derived-mode js-json-mode js-mode "JSON"
......
......@@ -162,6 +162,10 @@ Return nil if there is no name or if NODE is not a defun node."
(treesit-major-mode-setup))
(if (treesit-ready-p 'json)
(add-to-list 'auto-mode-alist
'("\\.json\\'" . json-ts-mode)))
(provide 'json-ts-mode)
;;; json-ts-mode.el ends here
;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2023 Free Software Foundation, Inc.
;; Version: 0.9.4
;; Version: 0.9.5
;; Package-Requires: ((emacs "26.1") (xref "1.4.0"))
;; This is a GNU ELPA :core package. Avoid using functionality that
......@@ -514,11 +514,14 @@ project backend implementation of `project-external-roots'.")
(lambda (b) (assoc-default b backend-markers-alist))