This fixes bug #60769. The two classes of "type" are foo and bar in
"foo d(bar () ...)", where the d could be a mistyped C-M-d.
* list/progmodes/cc-engine.el (c-forward-decl-or-cast-1): New local variable
got-arglist. Refactor a sequence of enclosed `if' forms into a `cond' form.
Set got-arglist when needed. In CASE 2, set unsafe-maybe to inhibit foo
being entered into c-found-types. In CASE 19, likewise set unsafe-maybe, to
inhibit bar entering c-found-types.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Add a rule for continuation of a hash pair.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--statement-container-regexp): Remove
"parenthesized_statements", it's not really a statement container,
not one we'd use for indentation alignment anyway.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
New function.
(ruby-ts--indent-rules): Use it for cases which need special
anchoring logic when inside a parenless method call.
Remove the ad-hoc handling of pair-hash-pair etc indentation,
which was there only for the parenless cases, apparently.
Have "No paren, ruby-parenless-call-arguments-indent is nil" case
align to the statement, if only because ruby-mode does that.
* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-parenless-call-arguments-indent.rb.
* lisp/window.el (split-window-below): Don't try to move point when
split-window-keep-point is nil and window-to-split is not the selected window
or nil (that defaults to the selected window) because code makes sense
only for the selected window.
(split-window-below, split-window-right): Improve docstrings (bug#60886)
Also it's compatible with 'M-s c' (isearch-toggle-case-fold)
used during Isearch. Also makes possible to use the global keybinding
'M-c' (capitalize-dwim) in the minibuffer.
* doc/lispref/minibuf.texi (Text from Minibuffer): Rename ‘M-c’ to ‘M-s c’.
* lisp/replace.el (read-regexp-map): Rebind ‘M-c’ to ‘M-s c’ (bug#60741).
(read-regexp-toggle-case-fold): Rename from read-regexp-toggle-case-folding
to more standard name.
(vc-dir-mode-map): Replace ‘%’ for vc-dir-mark-by-regexp
with ‘% m’ in regexp-map and ‘* %’ in mark-map (bug#60887).
* doc/emacs/maintaining.texi (VC Directory Commands): Replace ‘%’
with ‘% m’ and ‘* %’. Mention vc-dir-mark-registered-files.
* lisp/eshell/esh-var.el (eshell-get-variable):
* lisp/eshell/em-basic (eshell/echo): Don't use ':warning'; that's a
warning level, not a warning type.
This has been brought up in bug#60691 and bug#60223. I proposed a fix
by testing the size of the tree rather than measuring the query time.
But after some thought, I fear that just looking at the size will give
us false-negatives. So I kept the time-based activation, just added a
grace count to reduce false-positives.
* lisp/treesit.el:
(treesit--font-lock-fast-mode-grace-count): New variable.
(treesit--font-lock-notifier): Only activate fast mode after 5
offenses.
* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--method-call-indent-p): New function.
(ruby-ts--indent-rules): Use it.
* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-method-call-indent.rb.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add explicit value for ruby-method-call-indent.
* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--after-op-indent-p): New function.
(ruby-ts--indent-rules): Use it.
* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-after-operator-indent.rb.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Make sure indentation vars are at their default values.
Make it match ruby-mode's indentation behavior.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--binary-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it instead of a composite matcher.
Add a rule for 'conditional'.
(ruby-ts--assignment-ancestor, ruby-ts--is-in-condition)
(ruby-ts--endless-method): Remove.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add examples.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix/change indentation of a continuation method call.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New examples.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix indentation for parenthesized_expression and else/end after
'unless'.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New examples.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix the rules for hanging arrays and hashes (to line up to
parent-bol instead of the opening brace).
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New file with examples.
* test/lisp/progmodes/ruby-ts-mode-tests.el: Use it here.
* doc/misc/eshell.texi (Variables): Move footnote explaining "REPL"
from here...
(Top): ... to its first use here.
(Commands): Move explanation about kernel functions to here.
(Invocation): Describe command form and Lisp form. Fix documentation
about priority of commands in command form.
(Arguments): Add a cross reference to the Invocation node.
For this purpose, record the type names declared by typedef in a text
property, c-typedef, on the typedef. On any change to that "typedef" or a
type, remove the old identifier(s) from c-found-types.
This should fix bug #59671.
* lisp/progmodes/cc-defs.el (c-search-forward-non-nil-char-property): New
macro.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Move the scope of
identifier-start from the "inner" let form to the outer one. Amend the
return value such that the middle element of the second element is now the
position of the "typedef", not merely non-nil.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Disregard the LIMIT
parameter when fontifying the declarators of a typedef construct. Also in
this case, set the c-typedef text property on the "typedef" to the list of
declared types. Amend this list when these declared types change.
(c-font-lock-single-decl): Massage the `types' argument given to
c-font-lock-declarators.
(c-font-lock-cut-off-declarators): Amend to work when the starting point of
the fontification is inside a brace block.
* lisp/progmodes/cc-mode.el (c-before-change-de-typedef)
(c-after-change-de-typedef): New functions.
(c-update-new-id): Replace the erroneous c-end-of-current-token with a clause
containing c-forward-token-2.
(c-before-change): Call c-before-change-de-typedef.
(c-after-change): Call c-after-change-de-typedef.
* lisp/erc/erc-common.el (define-erc-module): Add symbol property
`erc-module' to minor modes defined as part of a module.
* lisp/erc/erc.el (erc--merge-local-modes): Be more conservative when
persisting local minor-mode state across ERC sessions. User and
third-party modes that were not defined via `define-erc-modules'
should be left alone.
(erc-open): Run major-mode hooks and enable minor modes after prompt
has been set up. This ensures that module-setup code can access a
fully initialized `erc-input-marker'.
* test/lisp/erc/erc-tests.el (erc--merge-local-modes): Add mocks for
`erc-module' symbol property and a test case covering some foreign ERC
mode.
(define-erc-module--global, define-erc-module--local): Expect the
`erc-module' symbol property to be defined for mode symbols and
aliases. (Bug#60784.)
* lisp/erc/erc.el (erc--target-priors): New internal variable to do
for target buffers what `erc--server-reconnecting' does for server
buffers.
(erc-open): Source the state of a local module's mode variable from
its actual buffer rather than its server buffer. Additionally, make
all local variables from a prior session available to
module-activation functions and `erc-mode' hooks, even when
`erc-reuse-buffers' is nil. This bug arrived with the introduction of
"local-modules" (bug#57955).
* test/lisp/erc/erc-scenarios-base-local-modules.el
(erc-scenarios-base-local-modules--toggle-helpers): Remove useless
`with-current-buffer'.
(erc-scenarios-base-local-modules--local-var, erc--phony-sblm--enable,
erc--phony-sblm--disable, erc--phony-sblm--mode): Add fake local
module and data var for test scenario.
(erc-scenarios-base-local-modules--var-persistence) Add slightly hacky
test case with promise to improve later when splitting the file.
* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): The
gv expander for `plist-get' was added in Emacs 28. But ERC still
supports 27, as of this function's introduction, in Emacs 29.
Fmake_indirect_buffer can be told whether to run buffer hooks since
bug#49160, but until now it ran buffer-list-update-hook irrespective
of this.
* src/buffer.c (Fmake_indirect_buffer): Don't run
buffer-list-update-hook when called with a non-nil
INHIBIT-BUFFER-HOOKS argument.
(run_buffer_list_update_hook): Don't special-case NULL argument, as
no such callers remain.
* test/src/buffer-tests.el
(buffer-tests-inhibit-buffer-hooks-indirect): Test whether indirect
buffer hooks are run regardless of whether base buffer hooks are
inhibited. Check that all three buffer hooks, not just
kill-buffer-query-functions, are inhibited.
The problem is due to a bug in ts_node_first_child_for_pos, but
tree-sitter is moving pretty slowly right now so I reimplemented a
correct version of it in treesit.c.
* src/treesit.c (treesit_cursor_first_child_for_byte): New function.
(Ftreesit_node_first_child_for_pos): Use the new function.
* lisp/htmlfontify.el (hfy-exclude-file-rules):
Fix broken defcustom type; no longer fails test-custom-opts.
Fix regexps not to use newline-sensitive patterns like `.` and `$`
which do not make sense when matching file names.
Better doc string.
* lisp/htmlfontify.el (hfy-list-files): Simplify regexp argument.
This should fix bug #60765. In the scenario type an identifier in front of
foo (bar, baz), as when started a new statement. This temporarily makes the
function call a declarator, and bar and baz types. Don't enter bar and baz
into c-found-types.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1) (CASE 6): When a
'maybe type triggers this case, set `unsafe-maybe' to non-nil.
Before this change, if a current connection existed at the time of M-x
eglot, user would be first asked to enter into M-x eglot's interactive
spec details about new command line arguments, and only afterwards be
prompted about what to do with the current connection (which could be
to reconnect to it using the same arguments, or tear it down and make
a new one).
This is very confusing, as users may not be fully aware of the
distinction between "reconnect" vs "disconnect-and-connect". They
might not know if any new command line arguments provided are taking
effect or not.
This change simplifies this and removes the option to "reconnect
instead" from M-x eglot (users can do that at any time via M-x
eglot-reconnect). It also ensures that users are informed about a
current connection before asking to enter new command line arguments
and not the other way round.
* lisp/progmodes/eglot.el (eglot): Rework.
* lisp/treesit.el (treesit-simple-indent-presets): Fix
prev-adaptive-prefix so it doesn't return nil if the previous line has
no prefix.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--block-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it.
* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-block-indent.rb.
* lisp/progmodes/js.el (js--treesit-indent-rules): Use more parent
anchors and fix typo with wrong indent offset variable.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Use more parent anchors.