* lisp/treesit.el (treesit-enabled-modes): New user option.
* src/treesit.c (treesit-major-mode-remap-alist): New variable.
* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/mhtml-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
Add ts-mode mapping to 'treesit-major-mode-remap-alist'
for ts-modes that already have the corresponding non-ts mode
association in 'auto-mode-alist'.
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode-maybe):
* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode-maybe):
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode-maybe):
* lisp/progmodes/go-ts-mode.el (go-ts-mode-maybe)
(go-mod-ts-mode-maybe, go-work-ts-mode-maybe):
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode-maybe):
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode-maybe):
* lisp/progmodes/php-ts-mode.el (php-ts-mode-maybe):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode-maybe):
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode-maybe)
(tsx-ts-mode-maybe):
* lisp/textmodes/markdown-ts-mode.el (markdown-ts-mode-maybe):
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-maybe):
Add a wrapper function to 'auto-mode-alist'
for ts-modes that have no corresponding non-ts mode.
Also add a mapping to 'treesit-major-mode-remap-alist'
for the case when a non-ts mode is installed from an external
source to be able to customize it with 'treesit-enabled-modes'.
The direct dependence on 'js-ts-mode', 'css-ts-mode' and
html-ts-mode has now been replaced by 'mhtml-ts-mode'.
Additional benefits are:
1. Imenu now exposes symbols for all of all languages,
2. navigation now works correctly for all languages,
3. outline works for all languages.
Additional new features are:
1. indentation of PHP in mixed buffers with HTML now works much
better and allows three different behaviors, an option allows you to
choose the behavior.
2. a new feature shows where PHP ini files are both locally and
remotely, if the buffer is associated with a remote PHP file.
* etc/NEWS: Mention the rationale for those changes, the new command,
and the new options.
* admin/tree-sitter/treesit-admin.el (treesit-admin--builtin-modes):
Added 'mhtml-ts-mode'.
(treesit-admin--builtin-features): Added 'mhtml-ts-mode'.
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--range-settings):
New variable that store range settings.
(mhtml-ts-mode--treesit-aggregated-outline-predicate): New variable
that stores outline predicates.
(mhtml-ts-mode): Use those two new variables.
* lisp/progmodes/php-ts-mode.el: Update doc string. Removed old
dependecies.
(php-ts-mode--language-source-alist): Updated parsers version.
(php-ts-mode-install-parsers): Removed old dependencies, now relies
on mhtml-ts-mode-install-parsers'. Update doc string.
(php-ts-mode-js-css-indent-offset): Update doc string.
(php-ts-mode-css-fontify-colors): Removed option, now relies on
'php-ts-mode-css-fontify-colors'.
(php-ts-mode-html-indent-offset): New user option.
(php-ts-mode-html-relative-indent): New user option.
(php-ts-mode-php-default-executable): Assume "php" instead of
"/usr/bin/php" if 'executable-find' fails.
(php-ts-mode-php-config): Fix tag.
(php-ts-mode-find-sibling-rules): New user option with the rules
for finding siblings of a file.
(php-ts-mode-phpdoc-highlight-errors): New user option, if non-nil
highlight unkown PHPDOC nodes.
(php-ts-mode--indent-style-setter): Indentation fix.
(php-ts-mode-indent-style): Indentation fix.
(php-ts-mode-flymake-php): Indentation fix.
(php-ts-mode--executable): Indentation fix.
(php-ts-mode-show-ini): New command that show the locations of PHP
ini files.
(php-ts-mode--get-indent-style): Indentation fix.
(php-ts-mode--set-indent-property): Indentation fix.
(php-ts-mode-set-style): Indentation fix.
(php-ts-mode--get-parser-ranges): Indentation fix.
(php-ts-mode--possibly-braceless-keyword-re): Removed no longer used
constant.
(php-ts-mode--open-statement-group-heuristic): Removed no longer used
function.
(php-ts-mode--else-heuristic): Indentation fix.
(php-ts-mode--first-sibling): Indentation fix.
(php-ts-mode--js-css-tag-bol): Function removed, now using
'mhtml-ts-mode--js-css-tag-bol'.
(php-ts-mode--parent-html-bol): Removed no longer used
function.
(php-ts-mode--parent-html-heuristic): Now more reliably handles the
mixed indentation of PHP and HTML. The new option
'php-ts-mode-html-relative-indent' changes the behavior of the
function. When 'php-ts-mode-html-relative-indent' is 't' the new
option 'php-ts-mode-html-indent-offset' controls the offset of PHP
code relative to HTML tags.
(php-ts-mode--array-element-heuristic): Indentation fix.
(php-ts-mode--anchor-prev-sibling): Indentation fix..
(php-ts-mode--indent-styles): The indentation rules for 'program' and
text_interpolation' are now common to all indentation styles, thanks
to the new version of 'php-ts-mode-arent-html-heuristic'. New rules
for 'namespace_use_clause', 'use_declaration', 'use_list',
'attribute_group' and 'string_content'.
(php-ts-mode--prettify-symbols-alist): New variable to support
'prettify-symbols-alist'.
(php-ts-mode--test-visibility-modifier-operation-clause-p): Rename ...
(php-ts-mode--test-visibility-modifier-operation-p): ... to this more
correct name.
(php-ts-mode--test-property-hook-clause-p): Rename ...
(php-ts-mode--test-property-hook-p): ... to this more correct name.
(php-ts-mode--test-relative-name-p): New function to test if
'relative_name' is supported by the PHP parser.
(php-ts-mode--font-lock-settings): Use the new function for highlight
'relative_name'. Highlight 'error_suppression_expression'.
Refactoring using the renamed functions. Indentation fix.
(php-ts-mode--custom-html-font-lock-settings): Replace the rules with
'mhtml-ts-mode--treesit-font-lock-settings'. Fix docs string.
(php-ts-mode--phpdoc-font-lock-settings): Added support for "array" and
"list" array_type. New "phpdoc-error" feature to highlight unknown
nodes via new 'php-ts-mode--phpdoc-fontify-error' function.
(php-ts-mode--colorize-css-value): Removed function no longer used, now
highlighting is handled directly by 'mhtml-ts-mode'.
(php-ts-mode--phpdoc-fontify-error): New function used by
'php-ts-mode--phpdoc-font-lock-settings'.
(php-ts-mode--parent-object): Indentation fix.
(php-ts-mode--defun-name-separator): Indentation fix.
(php-ts-mode--defun-object-name): Indentation fix.
(php-ts-mode--defun-name): The function now also returns the defun name
of 'mhtml-ts-mode'.
(php-ts-mode--treesit-defun-type-regexp): New regexp for
'treesit-defun-type-regexp' support.
(php-ts-mode--indent-defun): Indentation fix.
(php-ts-mode--defun-valid-p): Fix indentation
(php-ts-mode--comment-indent-new-line): Indentation fix.
(php-ts-mode--comment-current-plist): New local variable that stores
the state of the PHP comment style.
(php-ts-mode--comment-setup): The function now handles changing, for
different languages, comment styles, using
"php-ts-mode--comment-current-plist" to store and retrieve the comment
style for the PHP language.
(php-ts-mode-comment-setup): Now store the PHP comment style in
'php-ts-mode--comment-current-plist'.
(php-ts-mode-menu): Indentation fix.
(php-ts-mode): Replace dependency from JS, CSS and HTML width
'mhtml-ts-mode'. Navigation, Imenu and Outline now support PHP, HTML,
Javascript and CSS. Added support for 'prettify-symbol-mode'.
Added support for 'electric-layout-rules'.
(php-ts-mode-run-php-webserver, php-ts-mode--webserver-read-args)
(php-ts-mode--webserver-read-args, inferior-php-ts-mode, run-php)
(inferior-php-ts-mode-startup, php-ts-mode-inferior--write-history)
(php-ts-mode-send-region): Indentation fixes.
* lisp/treesit.el (treesit-range-rules): Check if treesit is available
before compiling a query.
(treesit-ensure-installed): Check if treesit is available before trying
to ensure if a grammar library is installed.
(Bug#78994)
The direct dependence on js-ts-mode, css-ts-mode and html-ts-mode
has now been replaced by 'mhtml-ts-mode'.
Additional benefits are:
1. Imenu now exposes symbols for all of all languages,
2. navigation now works correctly for all languages,
3. outline works for all languages.
Additional new features are:
1. indentation of PHP in mixed buffers with HTML now works much
better and allows three different behaviors, an option allows you to
choose the behavior.
2. a new feature shows where PHP ini files are both locally and
remotely, if the buffer is associated with a remote PHP file.
* etc/NEWS: Mention the rationale for those changes, the new command,
and the new options.
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--range-settings): New
variable that store range settings.
(mhtml-ts-mode--treesit-aggregated-outline-predicate): New variable
that store outline predicates.
(mhtml-ts-mode): Use those two new variables.
* lisp/progmodes/php-ts-mode.el: Update doc string. Removed old
dependencies.
(php-ts-mode--language-source-alist): Updated parsers version.
(php-ts-mode-install-parsers): Removed old dependencies, now relies
on (mhtml-ts-mode-install-parsers). Update doc string.
(php-ts-mode-js-css-indent-offset): Update doc string.
(php-ts-mode-css-fontify-colors): Removed option, now relies on
'php-ts-mode-css-fontify-colors'.
(php-ts-mode-html-indent-offset): New user option.
(php-ts-mode-html-relative-indent): New user option.
(php-ts-mode-php-default-executable): Assume \"php\" instead of
\"/usr/bin/php\" if 'executable-find' fails.
(php-ts-mode-php-config): Fix tag.
(php-ts-mode-find-sibling-rules): New user option with the rules for
finding siblings of a file.
(php-ts-mode-phpdoc-highlight-errors): New user option, if non-nil
highlight unkown PHPDOC nodes.
(php-ts-mode--indent-style-setter): Indentation fix.
(php-ts-mode-indent-style): Indentation fix.
(php-ts-mode-flymake-php): Indentation fix.
(php-ts-mode--executable): Indentation fix.
(php-ts-mode-show-ini): New command that show the locations of PHP
ini files.
(php-ts-mode--get-indent-style): Indentation fix.
(php-ts-mode--set-indent-property): Indentation fix.
(php-ts-mode-set-style): Indentation fix.
(php-ts-mode--get-parser-ranges): Indentation fix.
(php-ts-mode--possibly-braceless-keyword-re): Removed no longer
used constant.
(php-ts-mode--open-statement-group-heuristic): Removed no longer
used function.
(php-ts-mode--else-heuristic): Indentation fix.
(php-ts-mode--first-sibling): Indentation fix.
(php-ts-mode--js-css-tag-bol): Function removed, now using
'mhtml-ts-mode--js-css-tag-bol'.
(php-ts-mode--parent-html-bol): Removed no longer used
function.
(php-ts-mode--parent-html-heuristic): Now more reliably handles
the mixed indentation of PHP and HTML. The new option
'php-ts-mode-html-relative-indent' changes the behavior of the
function. When 'php-ts-mode-html-relative-indent' is 't' the new
option 'php-ts-mode-html-indent-offset' controls the offset of PHP
code relative to HTML tags.
(php-ts-mode--array-element-heuristic): Indentation fix.
(php-ts-mode--anchor-prev-sibling): Indentation fix..
(php-ts-mode--indent-styles): The indentation rules for 'program'
and 'text_interpolation' are now common to all indentation styles,
thanks to the new version of 'php-ts-mode-arent-html-heuristic'.
New rules for 'namespace_use_clause', 'use_declaration',
'use_list', 'attribute_group' and 'string_content'.
(php-ts-mode--prettify-symbols-alist): New variable to support
'prettify-symbols-alist'.
(php-ts-mode--test-visibility-modifier-operation-clause-p): Rename ...
(php-ts-mode--test-visibility-modifier-operation-p): ... to this more
correct name.
(php-ts-mode--test-property-hook-clause-p): Rename ...
(php-ts-mode--test-property-hook-p): ... to this more correct name.
(php-ts-mode--test-relative-name-p): New function to test if
'relative_name' is supported by the PHP parser.
(php-ts-mode--font-lock-settings): Use the new function for highlight
'relative_name'. Highlight 'error_suppression_expression'.
Refactoring using the renamed functions. Indentation fix.
(php-ts-mode--custom-html-font-lock-settings): Replace the rules with
'mhtml-ts-mode--treesit-font-lock-settings'. Fix docs string.
(php-ts-mode--phpdoc-font-lock-settings): Added support for "array"
and "list" array_type. New "phpdoc-error" feature to highlight
unknown nodes via new 'php-ts-mode--phpdoc-fontify-error' function.
(php-ts-mode--colorize-css-value): Removed function no longer used,
now highlighting is handled directly by 'mhtml-ts-mode'.
(php-ts-mode--phpdoc-fontify-error): New function used by
'php-ts-mode--phpdoc-font-lock-settings'.
(php-ts-mode--parent-object): Indentation fix.
(php-ts-mode--defun-name-separator): Indentation fix.
(php-ts-mode--defun-object-name): Indentation fix.
(php-ts-mode--defun-name): The function now also returns the defun
name of 'mhtml-ts-mode'.
(php-ts-mode--treesit-defun-type-regexp): New regexp for
'treesit-defun-type-regexp' support.
(php-ts-mode--indent-defun): Indentation fix.
(php-ts-mode--defun-valid-p): Fix indentation.
(php-ts-mode--comment-indent-new-line): Indentation fix.
(php-ts-mode--comment-current-plist): New local variable that stores
the state of the PHP comment style.
(php-ts-mode--comment-setup): The function now handles changing, for
different languages, comment styles, using
"php-ts-mode--comment-current-plist" to store and retrieve the comment
style for the PHP language.
(php-ts-mode-comment-setup): Now store the PHP comment style in
'php-ts-mode--comment-current-plist'.
(php-ts-mode-menu): Indentation fix.
(php-ts-mode): Replace dependency from JS, CSS and HTML width
'mhtml-ts-mode'. Navigation, Imenu and Outline now support PHP, HTML,
Javascript and CSS. Added support for 'prettify-symbol-mode'.
Added support for 'electric-layout-rules'.
(php-ts-mode-run-php-webserver, php-ts-mode--webserver-read-args)
(php-ts-mode--webserver-read-args, inferior-php-ts-mode, run-php)
(inferior-php-ts-mode-startup, php-ts-mode-inferior--write-history)
(php-ts-mode-send-region): Indentation fixes.
(Bug#78994)
* lisp/treesit.el (treesit-language-source-alist):
Document the format that uses keywords.
(treesit--install-language-grammar-1): Remove args
'revision', 'source-dir', 'cc', 'c++', 'commit'.
Use 'args' to process the keywords, and use the remaining
list as the previous list of arguments.
(treesit--install-language-grammar-1): Let-bind
'treesit--install-language-grammar-full-clone' and
'treesit--install-language-grammar-blobless' to t
when 'commit' is non-nil (bug#78542).
* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/elixir-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/heex-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/rust-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/html-ts-mode.el:
* lisp/textmodes/markdown-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el:
Use the keyword :commit with full hashes instead of tags
in 'treesit-language-source-alist'.
* lisp/treesit-x.el (define-treesit-generic-mode):
Simplify the keyword :copy-queries.
(gitattributes-generic-ts-mode, liquid-generic-ts-mode):
Add keywords :commit and :copy-queries to :source.
* admin/tree-sitter/treesit-admin.el
(treesit-admin--unversioned-treesit-language-source-alist):
Handle :revision and :commit as well.
(treesit-admin--find-latest-compatible-revision):
Process the keywords in the recipe.
* lisp/textmodes/mhtml-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
Use 'add-to-list' on items in language-source-alist
that should check for duplicate items.
* test/infra/Dockerfile.emba: Move multi-language mhtml-ts-mode and
php-ts-mode to the end to give their dependent grammars a lower priority.
* test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation):
Skip the test when 'jsdoc' is missing since 'js-ts-mode' depends
on the 'jsdoc' grammar.
* admin/notes/tree-sitter/build-module/build.sh:
Update org for toml/yaml.
* admin/tree-sitter/treesit-admin.el
(treesit-admin--builtin-language-sources):
Add verified versions.
* lisp/progmodes/c-ts-mode.el:
Append language source to treesit-language-source-alist.
(c-ts-mode, c++-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/cmake-ts-mode.el:
Append language source to treesit-language-source-alist.
(cmake-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/csharp-mode.el:
Append language source to treesit-language-source-alist.
(csharp-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/dockerfile-ts-mode.el:
Append language source to treesit-language-source-alist.
(dockerfile-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/elixir-ts-mode.el:
Append language source to treesit-language-source-alist.
(elixir-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/go-ts-mode.el:
Append language source to treesit-language-source-alist.
(go-ts-mode, go-mod-ts-mode, go-work-ts-mode):
Use treesit-ensure-installed.
* lisp/progmodes/heex-ts-mode.el:
Append language source to treesit-language-source-alist.
(heex-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/java-ts-mode.el:
Append language source to treesit-language-source-alist.
(java-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/js.el:
Append language source to treesit-language-source-alist.
(js-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/json-ts-mode.el:
Append language source to treesit-language-source-alist.
(json-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/lua-ts-mode.el:
Append language source to treesit-language-source-alist.
(lua-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist):
Update versions from comments in ts-modes.
Append to treesit-language-source-alist.
(php-ts-mode-install-parsers):
Use treesit-language-source-alist directly.
(php-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/ruby-ts-mode.el:
Append language source to treesit-language-source-alist.
(ruby-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/rust-ts-mode.el:
Append language source to treesit-language-source-alist.
(rust-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/sh-script.el:
Append language source to treesit-language-source-alist.
(bash-ts-mode): Use treesit-ensure-installed.
* lisp/progmodes/typescript-ts-mode.el:
Append language source to treesit-language-source-alist.
(typescript-ts-mode, tsx-ts-mode): Use treesit-ensure-installed.
* lisp/textmodes/css-mode.el:
Append language source to treesit-language-source-alist.
(css-ts-mode): Use treesit-ensure-installed.
* lisp/textmodes/html-ts-mode.el:
Append language source to treesit-language-source-alist.
(html-ts-mode): Use treesit-ensure-installed.
* lisp/textmodes/markdown-ts-mode.el:
Append language source to treesit-language-source-alist.
(markdown-ts-mode): Use treesit-ensure-installed.
* lisp/textmodes/mhtml-ts-mode.el
(mhtml-ts-mode--language-source-alist):
Append to treesit-language-source-alist.
(mhtml-ts-mode-install-parsers):
Use treesit-language-source-alist directly.
(mhtml-ts-mode): Use treesit-ensure-installed.
* lisp/textmodes/toml-ts-mode.el:
Append language source to treesit-language-source-alist.
(toml-ts-mode): Use treesit-ensure-installed.
* lisp/textmodes/yaml-ts-mode.el:
Append language source to treesit-language-source-alist.
(yaml-ts-mode): Use treesit-ensure-installed.
* test/infra/Dockerfile.emba: Add verified versions
to treesit-language-source-alist.
* lisp/treesit.el (treesit-forward-sexp): Don't use
'treesit-sexp-type-regexp' reserved for list commands
to override their default 'list' thing.
(treesit-down-list, treesit-up-list): Use
'treesit-sexp-type-regexp' instead of 'list'
when it's non-nil.
(treesit-toggle-sexp-mode): New command.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--thing-settings):
Improve 'sexp' thing settings to exclude the top-level
"translation_unit" that just moves to EOF and also "comment".
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--sexp-regexp): Remove.
(elixir-ts--forward-sexp): Remove to use the default 'sexp' navigation.
(elixir-ts--with-parens-0-p, elixir-ts--with-parens-1-p):
New internal functions.
(elixir-ts-mode): Add 'treesit-thing-settings'
instead of 'forward-sexp-function' (bug#76788).
* lisp/progmodes/heex-ts-mode.el (heex-ts--sexp-regexp): Remove.
(heex-ts--forward-sexp): Remove to use the default 'sexp' navigation.
(heex-ts--thing-settings): New variable.
(heex-ts-mode): Use 'heex-ts--thing-settings'
instead of 'forward-sexp-function'.
* lisp/progmodes/java-ts-mode.el (java-ts-mode):
Improve 'sexp' thing to use settings like in c-ts-mode.
* lisp/progmodes/php-ts-mode.el (php-ts-mode):
Improve 'sexp' thing settings to exclude the top-level
"program" that just moves to EOF and also "comment".
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Improve 'sexp' thing to use settings like in c-ts-mode.
* lisp/textmodes/css-mode.el (css--treesit-thing-settings):
Add 'sexp' thing. Add "string_value" to 'text' thing.
* lisp/textmodes/html-ts-mode.el (html-ts-mode--treesit-things-settings):
Improve 'sexp' thing to use settings like in c-ts-mode.
Add "doctype" to the 'list' thing.
* lisp/treesit.el (treesit-outline-search): Remove
temporary arg 'recursive'. Use iteration to visit
more ranges until the next outline heading is found.
* lisp/progmodes/php-ts-mode.el (php-ts-mode):
Set 'treesit-outline-predicate' explicitly.
* doc/lispref/parsing.texi (Multiple Languages): The variable
'treesit-language-at-point-function' is now optional for
multi-language major modes. Add description of 'treesit-parsers-at'.
* lisp/treesit.el (treesit-language-at-point-function):
Change the the docstring to remove the dissuasion against
deriving the language from parser ranges.
(treesit-language-at): Use the first parser from
'treesit-parsers-at' as the default return value when
'treesit-language-at-point-function' is nil. Adapt the docstring.
(treesit-node-at): Use 'treesit-parsers-at'.
(treesit-parsers-at): New function.
(treesit-local-parsers-at): Use 'treesit-parsers-at'
with the most part of the body moved to it.
(treesit-local-parsers-on): Replace the overlay property
'treesit-parser' with 'treesit-parser-local-p' in the docstring.
(treesit-up-list, treesit-simple-imenu, treesit-outline-level):
Use 'treesit-parsers-at'.
* lisp/progmodes/c-ts-mode.el (c-ts-mode): Don't set
'treesit-language-at-point-function'.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--treesit-language-at-point):
Remove.
(elixir-ts-mode): Don't set 'treesit-language-at-point-function'.
* lisp/progmodes/js.el (js--treesit-language-at-point): Remove.
(js-ts-mode): Don't set 'treesit-language-at-point-function'.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--html-language-at-point)
(php-ts-mode--language-at-point): Remove.
(php-ts-mode): Don't set 'treesit-language-at-point-function'.
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--language-at-point):
Remove.
(mhtml-ts-mode): Don't set 'treesit-language-at-point-function'.
Use 'treesit-language-at' for mode-line lighter.
e6b4c0bceb lisp/emacs-lisp/cl-macs.el (cl-labels): Fix docstring (bu...
7a976d1aaf Fix minor issues in documentation of `use-package'
99ff59bd66 PHP should be in the PATH, either locally or remotely. (b...
26873d5028 Avoid warning when loading 'go-ts-mode'
a702f29a00 ; Fix package-version values
a1fbc51dc7 ; * lisp/which-key.el (which-key-idle-delay): Fix package...
# Conflicts:
# lisp/progmodes/php-ts-mode.el
# lisp/which-key.el
* lisp/progmodes/php-ts-mode.el
(php-ts-mode-php-default-executable): Renamed from
'php-ts-mode-php-executable'.
(php-ts-mode--executable): New function that returns the absolute
filename of the PHP executable, local or remote, based on
'default-directory'.
(php-ts-mode--anchor-prev-sibling): Replaced 'when-let' with
“when-let*.”
(php-ts-mode--indent-defun): Replaced 'when-let' with
'when-let*'.
(php-ts-mode-run-php-webserver): Use the new function
(php-ts-mode-php-default-executable).
(run-php): Use the new function (php-ts-mode-php-default-executable).
* lisp/progmodes/csharp-mode.el (csharp-ts-mode): Add the
'list' and 'sentence' things to 'treesit-thing-settings'.
Set 'treesit-outline-predicate'.
* lisp/progmodes/go-ts-mode.el (go-ts-mode):
Add 'treesit-thing-settings' with the 'list' and 'sentence' things.
* lisp/progmodes/php-ts-mode.el (php-ts-mode):
Add the 'list' thing to 'treesit-thing-settings'.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode):
Add 'treesit-thing-settings' with the 'list' thing.
afb34a3b23 ; Improve documentation of ':box' face attribute
b38eb6da1d Fix docstring of c-ts-mode-indent-style
9fdb764898 Support PHP 8.4 and more reliable indentation (bug#74525)
bda0bce9e4 Don't inadvertently reset frame scroll bar sizes (Bug#74435)
3f99cdaf26 Mention special variables in lexical binding documentation
0ef0f18f16 Allow to go back to using 'ruby-mode' after loading 'ruby...
fc17e8727d Delete obsolete section in admin/notes/repo
3e396b2c5b Improve documentation for 'while-let'
50b91ed458 Remove mention of treesit-defun-prefer-top-level (bug#74474)
03ae07291e Fix NS non-native fullscreen on initial frame load (bug#5...
8261d7224d Fix user options for listing and marking diary files
# Conflicts:
# lisp/progmodes/c-ts-mode.el
Added support for PHP 8.4 property hook. More reliable CSS and
Javascript syntax indentation when there are attributes in
<script> and <style>.
* lisp/progmodes/php-ts-mode.el:
(php-ts-mode--language-source-alist): Switch to the latest php
grammar.
(php-ts-mode--js-css-tag-bol): CSS and Javascript indentation is
now more more reliable in different formatting styles.
(php-ts-mode--test-property-hook-clause-p): New function that
tests property_hook support.
(php-ts-mode--font-lock-settings): Use the new function.
(php-ts-mode--colorize-css-value): The function now behaves
exactly like the one in css-ts-mode.
(php-ts-mode--feature-list): Changed the list to match
css-ts-mode.
treesit-defun-prefer-top-level is removed before Emacs 29
released and was replaced by treesit-defun-tactic. These
statements that set it doesn't do anything other than introduce
confusion, so we should remove them.
* lisp/progmodes/c-ts-mode.el (c-ts-base-mode):
* lisp/progmodes/js.el (js-ts-mode):
* lisp/progmodes/php-ts-mode.el (php-ts-mode):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-base-mode):
Remove statements setting treesit-defun-prefer-top-level.
f69f54c454 Improve font-locking and indentation in 'php-ts-mode'
27aacbd172 Fix some 'lua-ts-mode' options (Bug#74235)
a0613372a7 ; Update the xwidgets-on-NS text due to fixing bug#60703
d592832504 Improve comment indenting in 'lua-ts-mode'
6bc44ccf28 Update 'xref-num-matches-found' when reverting *xref* buffer
8afcfed825 * lisp/files.el (require-with-check): Fix last fix (bug#7...
3496234c8e lisp/files.el (require-with-check): Fix bug#74091.
90c97d3fac Fix handling of permanent-local variables in 'kill-all-lo...
c96e576090 Precise password cache in Tramp
3954e8d9bb Fix picture-mode with full-width characters
7dabfe9465 Fix movement to the left in picture-mode
# Conflicts:
# lisp/net/tramp.el
* lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist):
Updated to latest version of PHP grammar.
(php-ts-mode--indent-styles): 'namespace_use_declaration' is now
correctly indented.
(php-ts-mode--operators): Support of the "argument unpacking
operator".
(php-ts-mode--font-lock-settings): 'nullsafe_member_call_expression'
is now highlighted correctly.
(php-ts-mode--comment-indent-new-line): Delete trailing whitespace
before inserting newline (see bug#73900 for more information).
Bug#74239
Incomplete compound_statement or colon_block (statement-group
without a closing brace or closing keyword) that are not inside
a function or method are not recognized as such by tree-sitter-php.
A new function 'php-ts-mode--open-statement-group-heuristic'
handles this case. Font locking of magic methods and better
support for alternative control structure syntax.
Support for latest grammar version.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist): Updated grammar version.
(php-ts-mode--possibly-braceless-keyword-re): Regular expression
for braceless keyword.
(php-ts-mode--open-statement-group-heuristic): New function.
(php-ts-mode--parent-html-bol): Use the new function and doc fix.
(php-ts-mode--parent-html-heuristic): Use the new function and doc
fix.
(php-ts-mode--indent-styles): Use the new function and add
'colon_block' support.
(php-ts-mode--class-magic-methods): New predefined magic methods
list.
(php-ts-mode--test-namespace-name-as-prefix-p): Doc fix.
(php-ts-mode--test-namespace-aliasing-clause-p): Fix the test and
doc.
(php-ts-mode--test-namespace-use-group-clause-p): Doc fix.
(php-ts-mode--test-visibility-modifier-operation-clause-p): New
function for the new asymmetric property visibility feature of
PHP 8.4.
(php-ts-mode--font-lock-settings): Font lock for class magic methods
and alternative syntax. Better font lock for 'instanceof'. Use
'font-lock-function-call-face' for scoped and member call expression.
(bug#73779)
Version 0.23 of the PHP grammar introduced some changes that
affect the font lock.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist): Update php, html, js and css
grammars version.
(php-ts-mode--parent-html-heuristic): Fix docstring
(php-ts-mode--test-namespace-name-as-prefix-p): New function.
(php-ts-mode--test-namespace-aliasing-clause-p): New function.
(php-ts-mode--test-namespace-use-group-clause-p): New function.
(php-ts-mode--font-lock-settings): Use the new functions.
A new CONFIG attribute, which defaults to 'php-ts-mode-php-config',
allows an alternative php.ini file to be specified for the built-in web
server. The 'php-ts-mode-run-php-webserver' function, when called
interactively with a prefix argument, also requires this new attribute.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--parent-html-bol):
Fix docstring.
* lisp/progmodes/php-ts-mode.el (php-ts-mode-run-php-webserver):
New CONFIG attribute. Update docstring.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--webserver-read-args):
Support the new TYPE. Update docstring. (Bug#72966)
In the <script> element, enable jsdoc embedding in JavaScript.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist): Add jsdoc to parser recipe.
(php-ts-mode): Add jsdoc parser check and a new rule for
'treesit-range-settings'. Update the commentary section.
(Bug#71771)
If the value of a property is text representing a CSS color,
it will be fontified such that its background is the color
itself. 'php-ts-mode-css-fontify-colors' can be used to
disable this behaviour.
* lisp/progmodes/php-ts-mode.el (php-ts-mode-css-fontify-colors):
New custom var.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--colorize-css-value):
New function.
* lisp/progmodes/php-ts-mode.el (php-ts-mode): Use the new
function. (Bug#71724)
For some control structures, PHP provides an alternative syntax.
A new rule has been added to handle this syntax.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--indent-styles):
New rule for PHP alternative syntax. (Bug#71710)
The old regex also captured functions with two or more
uppercase characters. This new regex fixes that issue.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--font-lock-settings):
New regex that match only user-defined constants. (Bug#71593)