sh-mode--treesit-settings: Ensure all variable use is treated the
same way.
Before this patch the following commands would all be treated differently:
echo "${var}"
echo "$var"
echo ${var}
echo $var
Now they are treated the same.
* lisp/progmodes/sh-script.el (sh-mode--treesit-settings): Tweak
rules. (Bug#78167)
When calculating the face for boxdraw chars, protect against
diagnostics with an empty first line. Also don't inherit from
:default, which seems to mess up the background color when using
hl-line-mode.
* lisp/progmodes/flymake.el (flymake--eol-draw-fancy): Tweak
In Bash, the characters !%:.^~, are not valid in variable names. In sh,
they are not permitted in either function or variable names. Treating
them as punctuation is convenient, as they are rarely used in function
names and never in variable names. Even among commands, their usage is
uncommon. The only character among these that is commonly seen in
command names is '.', although it is rarely used in function names.
Marking these characters as punctuation, rather than symbol
constituents, enhances the accuracy of symbol detection.
* lisp/progmodes/sh-script.el: Mark !%:.^~, as punctuation in the
sh-mode-syntax-table syntax table.
Copyright-paperwork-exempt: yes
* lisp/progmodes/python.el (python--treesit-settings): Use more
specific selectors for constants.
* test/lisp/progmodes/python-tests.el
(python-ts-mode-nested-types-face-1)
(python-ts-mode-union-types-face-1)
(python-ts-mode-union-types-face-2): None is now a constant.
This adds `next-error' support for flymake diagnostics buffers.
Buffers created with `flymake-show-buffer-diagnostics' and
`flymake-show-project-diagnostics' are now next-error enabled,
and `next-error' and `previous-error' will navigate through
their listed diagnostics.
* lisp/progmodes/flymake.el (flymake-current-diagnostic-line)
(flymake--diagnostics-next-error): Add.
(flymake-show-diagnostic, flymake-show-buffer-diagnostics)
(flymake-show-project-diagnostics): Set next-error-last-buffer.
(flymake--tabulated-setup): Set next-error-function.
(Bug#77809)
Copyright-paperwork-exempt: yes
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--thing-settings):
Add extra grouping "keywords" to named sexp nodes.
Add "," to anonymous sexp nodes. Use bos/eos.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Use bos/eos for anonymous sexp nodes for better disambiguation.
* test/lisp/progmodes/heex-ts-mode-tests.el
(heex-ts-mode-test-indentation): Skip the test when 'elixir' is
missing since 'heex-ts-mode' depends on the 'elixir' grammar.
* 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.
Improve the handling of #error and #warning in C and C++ Modes.
* lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute)
(c-enclosing-c++-attribute, c-forward-sws, c-backward-sws):
Handle attributes in C as they have been handled in C++.
(c-forward-align-clause-throw-if-invalid): New macro.
(c-forward-type): Handle alignas, alignof, and _BitInt, putting
a catch block around most of the function to catch invalid uses
of these new keywords.
(c-in-id-arglist): New function.
(c-forward-decl-or-cast-1): Recognize a "maybe" type identifier
as a type in arglists when there is no parameter identifier
associated with it.
* lisp/progmodes/cc-fonts.el (c-font-lock-cpp-messages): New
function.
(c-cpp-matchers): Move the handling of "invalid" comment
delimiters outside of the block handling CPP directives.
Remove the inline handling of #error and #warning, using the
new function c-font-lock-cpp-messages instead.
(c-get-fontification-context): Handle alignof, alignas,
_BitInt.
(c-font-lock-declarations): Adapt fontification of K&R
parameters to the C23 nameless parameter scheme.
* lisp/progmodes/cc-langs.el (c-has-quoted-numbers)
(c-stmt-boundary-skip-chars)
(c-recognize-post-brace-list-type-p, c-modifier-kwds)
(c-constant-kwds): Handle C the same as the existing C++
handling.
(c-cpp-message-directives-re, noncontinued-line-end)
(c-cpp-messages-re, c-cpp-message-match-no): New
c-lang-consts/vars.
(c-cpp-include-directives): New directive embed.
(c-cpp-expr-directives): New directives elifdef, elifndef.
(c-primitive-type-kwds): New types, _Decimal*, bool, char*_t,
nullptr_t.
(c-typeof-kwds): New keyword typeof_unqual.
(c-type-with-paren-kwds, c-type-with-paren-key): New
c-lang-const/vars.
(c-type-modifier-with-parens-kwds)
(c-type-modifier-with-parens-key, c-type-internal-paren-kwds)
(c-type-internal-paren-key): New c-lang-const/vars.
(c-type-modifier-prefix-kwds, c-type-start-kwds): Amend with
the above new c-lang-consts.
(c-no-type-with-equals-kwds, c-no-type-with-equals-key): New
c-lang-const/vars.
(c-modifier-kwds): Add constexpr, auto, and thread_local to the
C value.
(c-paren-nontype-kwds): Add static_assert to the C value.
(c-constant-kwds): Add nullptr to the C value.
(c-regular-keywords-regexp): Include c-type-with-paren-kwds.
(c-recognize-nameless-type-decls): New c-lang-const/var.
* lisp/progmodes/cc-mode.el (c-leave-cc-mode-mode): Also clear
c-digit-separator properties.
Improves:
- fontification of generic types with namespace-prefixes
- function-call parameters
- variable use in string interpolation
- implicitly typed parameters in lambda-expressions
- index-expressions
- variables used in return-statements
- variables used in binary expressions
* lisp/progmodes/csharp-mode.el:
(csharp-ts-mode--font-lock-settings): Improve queries.
When we don't have anything to give to Flymake, we still want to
signal we're alive so the mode-line doesn't show a confusing
'Wait'.
* lisp/progmodes/eglot.el (eglot--report-to-flymake): Clear 'Wait'
state.
* lisp/progmodes/cperl-mode.el (cperl-mode-map): Don't bind C-j.
The default global mode bindings will DTRT depending on whether
or not electric-indent-mode is on.
* lisp/outline.el (outline-font-lock-keywords): For non-nil
outline-search-function return a lambda that calls the function,
then sets the match data to the end of the line that is equivalent
to adding ".*" in the regexp. Then search functions don't need to
match ".*" themselves.
* lisp/progmodes/elisp-mode.el (elisp-outline-search):
New function to skip leading parens in strings when searching
for outline headings.
(emacs-lisp-mode): Set buffer-local 'outline-search-function' to
'elisp-outline-search'.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00934.html
In the vast majority of cases, changing the source overlay
invalidates the content of the end-of-line overlay, so best to
delete it asap.
* lisp/progmodes/flymake.el (flymake--delete-overlay): Use
'flymake--eol-ov'
(flymake--highlight-line): Use some overlay modification hooks.
After a change in the buffer has occured, it is often the case
that Flymake is quicker to ask for diagnostics than the server
is to supply them to us. If we're still stuck with old outdated
diagnostics, don't forward them to Flymake, even if it eagerly
asks us for them.
* etc/EGLOT-NEWS (Changes in upcoming Eglot): Announce changes.
* lisp/progmodes/eglot.el
(eglot--diagnostics): Rework.
(eglot--report-to-flymake): Also take version.
(eglot-handle-notification textDocument/publishDiagnostics)
(eglot--managed-mode)
(eglot-flymake-backend): Tweak call to eglot--report-to-flymake.
* lisp/progmodes/csharp-mode.el
(csharp-ts-mode--font-lock-settings): Remove too wide selector,
causing non-string content to be fonitified as strings. Add
additional eselectors to highlight variables inside
interpolation-expressions too. (Bug#78008)
* lisp/progmodes/gud.el (gud-query-cmdline): Add an optional
default-list parameter to allow passing a list of "forward
history" suggestions to the minibuffer.
(perldb, pdb, guiler): Use buffer file name to suggest a default
debugging command via "forward history".
* doc/emacs/building.texi (Starting GUD): Document the new
feature.
(Bug#77989)
* lisp/progmodes/grep.el
(grep-compilation-transform-finished-rules): New variable
containing rules to prevent "Grep finished" lines from being
misinterpreted as matches for file names.
(grep-mode): Add these rules to
'compilation-transform-file-match-alist' (bug#77732).
'comint-filename-completion' may complete the filename at
wrong locations. Users who want proper filename completion
should use specialized completion backends (e.g. Jedi).
* lisp/progmodes/python.el (inferior-python-mode): Remove
'comint-filename-completion' in 'comint-dynamic-complete-functions'.
* lisp/progmodes/python.el (python-nav-cache)
(python-nav-cache-tick): New variables.
(python-nav-cache-get, python-nav-cache-set)
(python-nav-with-cache): New functions.
(python-nav-beginning-of-block, python-nav-end-of-block): New
wrapper functions.
(python-nav--beginning-of-block): Renamed from
'python-nav-beginning-of-block'.
(python-nav--end-of-block): Renamed from
'python-nav-end-of-block'. (Bug#77620)
* lisp/progmodes/python.el (python-info-statement-ends-block-p):
Add a comparison of the indentation of the next statement with
the indentation of the current statement. (Bug#77620)
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode-multivar-indent-style): New option.
(typescript-ts-mode--indent-rules): Support both styles.
As presently under discussion in bug#77823, the intended new
functionality is not really about comments at all.
Remove it for now to allow us to redesign from a clean slate,
and to deal with the regression reported in bug#77823.
This reverts the following three changesets:
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 17 12:56:52 2025 -0600
New minor mode: `electric-block-comment-mode'
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 31 17:58:16 2025 -0600
Add block-comment-start and block-comment-end to supported modes
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Sun Apr 13 12:26:08 2025 -0600
Add block-comment variables to cc-mode