Fix font lock in php-ts-mode when the tree-sitter grammars are
automatically installed. Also, update php-ts-mode to call the new
`mhtml-ts-mode--treesit-font-lock-settings' function.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--keywords)
(php-ts-mode--operators): Generate the lists after the tree-sitter
grammars are installed.
(php-ts-mode--font-lock-settings, php-ts-mode--font-lock-settings-cached)
(php-ts-mode--custom-html-font-lock-settings)
(php-ts-mode--custom-html-font-lock-settings-cached): Evaluate the rules
after the tree-sitter grammars are installed. Also, add cache for the
rules.
(php-ts-mode): Call the new
`php-ts-mode--custom-html-font-lock-settings' function. (Bug#79363)
* lisp/keymap.el (read-only-keymap-filter)
(read-only-keymap-bind): New functions, removed from
browse-url.el.
* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): Move to keymap.el. All callers
changed.
* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): New functions.
(browse-url-button-map): Bind "C-c RET" to 'browse-url-button-open'
and rebind "RET" with the filter 'browse-url-keymap-bind'.
* lisp/ansi-osc.el (ansi-osc-hyperlink-map):
* lisp/net/goto-addr.el (goto-address-highlight-keymap):
* lisp/progmodes/bug-reference.el (bug-reference-map):
Bind "RET" with the filter 'browse-url-keymap-bind'.
(js--treesit-sexp-nodes): Set the default value to nil and make obsolete.
(js--treesit-thing-settings): Instead of using
'js--treesit-sexp-nodes', define a list of named and anonymous nodes
that don't match the 'sexp' thing (bug#79465).
This fixes bug#79438.
* lisp/progmodes/cc-align.el (c-lineup-class-field-cont): New
function.
* lisp/progmodes/cc-vars.el (c-offsets-alist): Change the
entry for class-field-cont from + to
c-lineup-class-field-cont.
* doc/misc/cc-mode.texi (Misc Line-Up): Add a new entry for
c-lineup-class-field-cont.
Fix font lock and indentation in js-ts-mode when the tree-sitter grammar
is automatically installed (Bug#79363).
* lisp/progmodes/js.el (js--treesit-indent-rules)
(js--treesit-font-lock-settings): Evaluate the rules only after the
tree-sitter grammar is installed.
(js-ts-mode): Call the new `js--treesit-indent-rules' and
`js--treesit-font-lock-settings' functions.
- hightlight reserved keywords agressively, dont allow misuse as
variables etc (the compiler will fail!)
- highlight lambda-valued variables as funtions.
- improve semantics of function/class annotations using attributes
(maps closer to using-something than declaring it). also: rename to
"attribute". "property" has a different, defined meaning in C#.
- better highlight variable-use in different scenarios (function-calls,
if-statements, assignment-expressions, property-use, anonymous object
initializers).
- better highlight for property-use (anonymous object initializers).
- highlight field-declaration using font-lock-variable-face.
- fontify attributes using new face csharp-ts-mode-attribute-face
(defaults to font-lock-property-use-face).
- remove extensive use of "override" making evalutation hard-to-reason about.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules):
Update indent rules.
(csharp-ts-mode-faces): New group.
(csharp-ts-mode-attribute-face): New face.
(csharp-ts-mode--font-lock-settings): Rule updates.
(csharp-ts-mode): Change property feature to attribute
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Create an exception for assign-division operator not to be
recognized as regexp start (bug#79454).
* test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add example.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist):
For ABI version < 15 add the recommended version "v0.23.12" (full hash
"f7cf7348737d8cff1b13407a0bfedce02ee7b046").
* lisp/progmodes/gdb-mi.el (gdb-init-1): Delay processing of GDB
responses while waiting for the user to answer the question about
enabling debuginfod. (Bug#79403)
* lisp/progmodes/php-ts-mode.el: Doc string update.
(php-ts-mode--language-source-alist): PHP grammar update.
(php-ts-mode-find-sibling-rules): Doc string fix.
(php-ts-mode--parent-html-heuristic): Handled the case where there
is no HTML between two blocks of PHP code.
(php-ts-mode--array-element-heuristic): Fix typo.
(php-ts-mode--pipe-heuristic): New function that handle PHP's new
pipe operator.
(php-ts-mode--indent-styles): Removed commented code. More
accurate indentation of ‘member_call_expression’. Use of new
function to handle pipe operator indentation. New rule for
indenting ‘property_hook_list’.
(php-ts-mode--test-yield-from-p): New predicate to check whether
the 'yield from' keyword is supported by the PHP grammar.
(php-ts-mode--test-pipe-p): New predicate to check whether the
‘pipe’ operator is supported by the PHP grammar.
(php-ts-mode--keywords): Use the new predicate
'php-ts-mode--test-yield-from-p'. Now it is a var instead of a
const.
(php-ts-mode--operators): Use the new predicate
'php-ts-mode--test-pipe-p'. Now it is a var instead of a const.
(php-ts-mode--font-lock-settings): New rules for
'nullsafe_member_access_expression', 'callable' primitive type.
New rule for the 'php_end_tag' if supported by the grammar.
More precise rules for 'scoped_call_expression' and
'member_call_expression'.
(php-ts-mode--inferior-php-process): Removed this unnecessary
variable.
(inferior-php-ts-mode-startup): Removed the use of
'php-ts-mode--inferior-php-process'.
(php-ts-mode-inferior--write-history): Removed the use of
'php-ts-mode--inferior-php-process'.
(Bug#79339)
* lisp/progmodes/project.el: Fall back to adding 'project-buffer'
to 'completion-category-defaults' if 'define-completion-category'
is not available (bug#79409).
* lisp/vc/diff-mode.el (diff-find-matching-buffer): Rename ...
* lisp/progmodes/project.el
(project-change-to-matching-directory): ... to here. All uses
changed.
* lisp/vc/log-view.el (project-change-to-matching-directory):
Declare.
(log-view-mode): Use it.
* doc/emacs/vc1-xtra.texi (Other Working Trees): Document the
change.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules):
Adjust rules to fix the following incorrect behaviours:
- in multiline expressions/method call chains;
- in object initialization expressions;
- in array creation expressions.
Fix tree-sitter grammar installation issues in elixir-ts-mode and
heex-ts-mode (Bug#79363).
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings):
Check that tree-sitter is available.
(elixir-ts-mode): If the user answers "no" to installing the heex
tree-sitter grammar, do not ask again. Group heex settings.
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode): Ensure that elixir
tree-sitter grammar is installed.
Fix font lock in go-ts-mode when the tree-sitter grammar is
automatically installed (Bug#79363).
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Evaluate the rules only after the tree-sitter grammar is installed.
(go-ts-mode): Call the new `go-ts-mode--font-lock-settings' function.
Fix font lock and indentation in cmake-ts-mode when the tree-sitter
grammar is automatically installed (Bug#79363).
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--indent-rules)
(cmake-ts-mode--font-lock-settings): Evaluate the rules only after the
tree-sitter grammar is installed.
(cmake-ts-mode): Call the new `cmake-ts-mode--indent-rules' and
`cmake-ts-mode--font-lock-settings' functions.
* lisp/progmodes/gud.el (gud-lldb-marker-filter): Fix problem
where the source code location ends up at the last character of
the previous line if no (or zero) column is reported by lldb.
(Bug#79360)
Copyright-paperwork-exempt: yes
* lisp/minibuffer.el (define-completion-category): New function.
(completion-category-get): New function, implements completion
category property lookup with (multiple) inheritance.
(completion-metadata-get, completion--styles)
(completion--cycle-threshold): Use it.
(completion-category-defaults): Mention it in docstring.
Remove entry for 'project-buffer' category, and instead...
* lisp/progmodes/project.el: ...have 'project-buffer' inherit
from 'buffer'.
* test/lisp/minibuffer-tests.el
(completion-category-inheritance): New test.
* etc/NEWS: Announce support for category inheritance.
The previous change actually introduced a bug in a closely
related but distinct place. We need to address the off-by-one
in the 'substring' call, not the 'add-face-text-property'.
* lisp/progmodes/eglot.el (eglot--sig-info): Fixup.
The correct Emacs executable to use for
'elisp-flymake-byte-compile' is not necessarily the running
Emacs. For example, when editing trunk with Emacs 30,
various Lisp changes will cause spurious flymake warnings.
Add 'elisp-flymake-byte-compile-executable' to allow
customizing this.
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile-executable)
(elisp-flymake-byte-compile--executable): Add. (Bug#79342)
(elisp-flymake-byte-compile): Invoke
'elisp-flymake-byte-compile--executable'.
* etc/NEWS: Announce the change.
This feature was tweaked and last tested with a 2019 edition of
the 'ccls' LSP. The spec does not clearly specify this number
to be 0-indexed, but it would make sense that it would be so.
So there's not need to 1+ - correct the numbers at all before
using them in substring. This would fix the Haskell server use
of this feature (which is bug#79259)
* lisp/progmodes/eglot.el (eglot--sig-info): Fix likely off-by-1.
Escape literal % characters in Eglot URIs
Otherwise, a literal % in a file-name will be interpreted (by the
language server) as if it were a part of a percent-encoded sequence.
See Bug#78984 for context on why `url-path-allowed-chars' cannot be
changed to escape literal % characters.
* lisp/progmodes/eglot.el (eglot--uri-path-allowed-chars): Escape %,
remove the redundant variable definition.
* test/lisp/progmodes/eglot-tests.el (eglot-test-path-to-uri-escape):
test it.
* lisp/progmodes/lua-ts-mode.el (lua-ts--comment-font-lock):
Apply 'font-lock-comment-delimiter-face' to the entire span of
initial dashes. In particular, this improves the appearance of
LuaCATS and EmmyLua style annotations which use "---".
* test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua:
Add tests. (Bug#79258)
This fixes a failure in 'test-custom-opts' caused by both strings
and integers being used for 'lua-prefix-key'.
* lisp/progmodes/lua-mode.el (lua-prefix-key): Convert option to
'key-sequence' type.
(lua-mode-map, lua-prefix-key-update-bindings, lua-set-prefix-key)
(lua--customize-set-prefix-key): Adjust to the change of type for
'lua-prefix-key'.
(lua-prefix-mode-map): Use 'defvar-keymap'. (Bug#79335)
* lisp/progmodes/lua-mode.el (lua-indent-level): Contemporary Lua
style guides no longer recommend 3 as default. Change type to
'natnum'.
(lua-always-show, lua-get-block-token-info)
(lua--backward-up-list-noerror, lua-make-indentation-info-pair)
(lua-accumulate-indentation-info)
(lua-calculate-indentation-block-modifier): Quote function names.
(lua-toggle-electric-state): Re-format to avoid confusion.
(lua-is-continuing-statement-p-1): Fix typo.
(lua--builtins): Move docstring to correct location.
(lua-is-continuing-statement-p-1): Remove unnecessary 'or'.
(lua-make-lua-string): Remove excessive backslashes and
unnecessary use of a temporary buffer.
(lua-find-matching-token-word): Make it clear that 'goto-char' is
only used only for its side-effect.
* lisp/progmodes/ruby-mode.el (ruby-flymake-simple): Update
regular expression to handle new versions of Ruby including the
location of the executable in the output.
* lisp/progmodes/bug-reference.el (bug-reference-setup-from-vc-alist):
Add comment explaining the meaning of the nil argument when calling
vc-call-backend. Even though "origin" and nil are equivalent when using
the git backend, it is more intelligible to see "upstream" and "origin"
passed explicitly (bug#79276).