* lisp/time-stamp.el (time-stamp-once): Do not look for additional
templates once we have displayed the warning about being disabled.
Move earlier the check for arguments being the correct type.
* test/lisp/time-stamp-tests.el (time-stamp-custom-messages): New test.
* lisp/vc/diff-mode.el (diff-file-kill): New optional DELETE
parameter.
(diff-kill-creations-deletions):
* lisp/vc/vc.el (vc--fileset-by-state): New functions.
(diff-kill-creations-deletions, diff-filename-drop-dir)
(diff-hunk-file-names, diff-file-next, diff-hunk-header-re)
(vc-dir-resynch-file): Declare.
(vc--apply-to-other-working-tree): Handle copying and moving
files in the added, removed, missing and unregistered states.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--apply-to-other-working-tree): New test.
This patch adds tests for the following scenarios:
- Every element is handled (basic functionality)
- Result specified in SPEC is returned
- Bindings named "tail" are not shadowed by 'dolist'
* test/lisp/subr-tests.el (subr-tests--dolist--every-element-is-handled)
(subr-tests--dolist--returns-spec-result)
(subr-tests--dolist--does-not-shadow-tail-binding): New tests.
(Bug#79778)
The core of the problem is that `completion-pcm--prepare-delim-re`
is designed to match a "delimiter" in the pattern but was misused
to match a sequence of delimiter chars in the completions.
* lisp/minibuffer.el (completion-pcm--delim-re): Rename from
`completion-pcm--prepare-delim-re` and change its calling convention.
(completion-pcm--segments->regex): Use it.
(completion-pcm-word-delimiters): Adjust accordingly.
* test/lisp/minibuffer-tests.el (completion-pcm--test-zerowidth-delim):
New test.
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Check for ':' and
'=>' as previous tokens, and handle symbols ending with ':' to
properly indent keyword argument arrays and hashes when
ruby-bracketed-args-indent is nil.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol):
Handle arrays/hashes that are children of 'pair' nodes (keyword
arguments) to ensure consistent indentation.
* test/lisp/progmodes/ruby-mode-resources/ruby-bracketed-args-indent.rb:
Add test cases for keyword argument arrays and hashes with both
symbol-colon and hash-rocket syntax.
When ruby-bracketed-args-indent is nil, arrays and hashes used as
keyword argument values now indent by ruby-indent-level from the
line start, matching the documented behavior and fixing inconsistent
indentation (bug#74517).
(https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00939.html)
* lisp/replace.el (replace--push-stack): Add new args
'next-replacement' and 'match-again' and push them to the stack.
(perform-replace): Restore the previous already calculated values
of 'next-replacement' and 'match-again' from the stack for the
'backup' ('^') key (bug#79811).
* test/lisp/replace-tests.el (query-replace-tests): Add tests.
* lisp/textmodes/ispell.el (ispell-add-per-file-word-list): Deal
with `comment-end' in a way that works for comments that don’t
nest.
We proceed as follows: when `comment-end' is non-empty, we only
ever insert one start and one end comment, the first time we add
a local word. This works with both C-style (which don’t nest)
and Rust-style comments (which do).
If we’re using line comments (i.e. comments that only have a
`comment-start'), then continue to insert one on each line.
* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-add-per-file-word-list/nxml): Adjust test.
Bug#79871
* test/src/buffer-tests.el (test-restore-buffer-modified-p)
(test-buffer-chars-modified-ticks): Don't leave unsaved and
modified file buffers after the tests.
The tests are pretty basic, I don't expect them to catch
anything else than giant bugs.
* test/lisp/progmodes/eglot-tests.el (eglot-test-semtok-basic)
(eglot-test-semtok-refontify): New tests.
(eglot--semtok-faces, eglot--semtok-wait): New helpers.
* lisp/vc/vc-dispatcher.el (vc-do-command): Support discarding
standard error.
* lisp/vc/vc-hg.el (vc-hg-dir-status-files): Discard standard
error of 'hg status' to avoid parsing mistakes.
(vc-hg-command): Update docstring given new meaning of first
argument to vc-do-command.
* test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-do-command-1)
(vc-test-do-command-2, vc-test-do-command-3)
(vc-test-do-command-4, vc-test-do-command-5)
(vc-test-do-command-6, vc-test-do-command-7): New tests.
Newer/newest clangd support more encodings and actually
negotiate with us, so test shouldn't assume UTF-16..
* test/lisp/progmodes/eglot-tests.el
(eglot-tests--lsp-abiding-column-1): Tweak.
Credentials cached in 'url-basic-auth-storage' are keyed by
"server:port", but were being looked up by just "server" in
'url-basic-auth'.
* lisp/url/url-auth.el (url-basic-auth): Lookup cached basic auth
credentials by "server:port". (Bug#79486)
* test/lisp/url/url-auth-tests.el (url-auth-test-auth-retrieve-cache):
Check the digest auth test-cases cache retrieval test cases against the
basic auth logic.
* test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-exec-after-1)
(vc-test-exec-after-2, vc-test-exec-after-3)
(vc-test-exec-after-4, vc-test-exec-after-5): Fix shell commands
for MS-Windows: use "&" instead of ";" and don't use fractional
times for 'sleep', as some Windows ports of 'sleep' don't support
that.
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-test-ldiff):
* test/lisp/emacs-lisp/seq-tests.el (test-seq-union):
These tests relied on literal constants being unique in the sense of
'eq', and would fail if they stop being that (already the case for
strings).
* test/lisp/erc/erc-scenarios-base-reuse-buffers.el
(erc-scenarios-common--base-reuse-buffers-channel-buffers): Extend some
timeouts.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el
(erc-scenarios-keep-place-indicator--follow): Prefer `ert-skip' here
instead of an :unstable tag because ERC's tests can run locally on some
systems with "SELECTOR=t".
Latest tree-sitter library throws a syntax error if the
predicate names in a query don't end with question mark. So we
made the following change:
:equal changed to :eq?
:match changed to :match?
:pred changed to :pred?
Old names are transparently converted to new names when
expanding patterns.
:match predicate can now take the regexp and the node in any
order: it'll figure out which is which automatically. This way
it works with current Emacs convention (regexp first), as well
as tree-sitter's match convention (regexp second).
* doc/lispref/parsing.texi (Pattern Matching): Update manuel to
use new predicate names.
* src/treesit.c:
(Ftreesit_pattern_expand):
(Ftreesit_query_expand):
(treesit_predicate_match):
(treesit_eval_predicates):
(syms_of_treesit): Use new predicate names.
* test/src/treesit-tests.el (treesit-query-api): Update test.
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use the 'read-key'
branch only when the variable 'y-or-n-p-use-read-key' is non-nil.
Add a new cond-branch to read from the minibuffer.
Add a special case when def is nil in a kmacro in batch mode (bug#67836).
* test/lisp/files-tests.el (files-tests--with-buffer-offer-save):
Let-bind 'y-or-n-p-use-read-key' to t.
* doc/lispref/commands.texi (Reading One Event): Mention
'read-char-choice-use-read-key'.
* lisp/emacs-lisp/rmc.el (rmc--show-help): Show non-selected
resized Help window at bottom. Inhibit useless message.
Remove unnecessary call to 'pop-to-buffer'.
(read-multiple-choice): Call 'read-multiple-choice--from-minibuffer'
when 'read-char-choice-use-read-key' is nil.
(read-multiple-choice--from-minibuffer): New function.
* test/lisp/emacs-lisp/rmc-tests.el (test-rmc--with-minibuffer-setup):
New macro.
(test-read-multiple-choice, test-read-multiple-choice-help):
Test both values of 'read-char-choice-use-read-key'.
* lisp/emacs-lisp/cl-extra.el (cl--types-of-memo): Delete var.
(cl--derived-type-specializers-memo): New var.
(cl-types-of): Delete function.
(cl--derived-type-specializers): New function.
(cl--derived-type-dispatch-list): Delete var.
(cl--derived-type-generalizer): Use the `:need-specializers` API instead.
(cl--derived-type-generalizers): Don't fill
`cl--derived-type-dispatch-list` any more.
* lisp/emacs-lisp/cl-preloaded.el (cl--derived-type-list): Delete var.
(cl--define-derived-type): Don't add type to `cl--derived-type-list`.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-types-test): Adjust.
When multiple wildcards occur in a PCM pattern,
completion-pcm--pattern->regex previously would generate one
instance of [^z-a]* for each of those wildcards, even if the
wildcards were adjacent and could therefore be matched by a
single [^z-a]*. This can make regex matching performance much
worse. For example, with a minibuffer containing "*/" with
point at the start, completion-pcm-all-completions would take
several seconds to match in project-find-file in the Emacs repo.
Now, we run completion-pcm--pattern->segments on the pattern
first, which adds additional structure to the pattern, including
consolidating adjacent regexes into a single sublist. Then
completion-pcm--segments->regex generates a single regex
wildcard for each of those pattern wildcards. As a consequence,
we need to update the callers of completion-pcm--pattern->regex
which pass non-nil GROUP. This provides a substantial
performance improvement in various edge cases.
* lisp/minibuffer.el (completion-pcm--pattern->segments)
(completion-pcm--segments->regex): Add. (bug#79693)
(completion-pcm--pattern->regex)
(completion-pcm--merge-completions): Call pattern->segments and
segments->regex.
(completion-pcm--pattern-point-idx): Delete.
(completion-pcm--segments-point-idx): Add.
(completion-pcm--hilit-commonality): Call
completion-pcm--segments-point-idx to find the submatch
containing point.
* test/lisp/minibuffer-tests.el (completion-pcm-test-5): Add
more tests of highlighting the first difference.
(completion-pcm-test-pattern->regex): Add tests showing the
regex form of PCM patterns.
Replace the use of 'elisp-scope-face(-1)' for analyzing face
specifications with 'elisp-scope-1' calls with an
appropriate OUTSPEC argument. This allows us to analyze
face specifications even when they are not passed directly
to relevant functions, but rather appear in a tail position
of a form that evaluates to a face specification.
* lisp/emacs-lisp/elisp-scope.el
(elisp-scope--match-spec-to-arg): Add new 'face' spec.
Use it instead of...
(elisp-scope-face, elisp-scope-face-1): ...these functions.
Remove them, no longer used.
* test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el:
Add test.
* etc/ERC-NEWS: New section for ERC 5.6.2 and new entry mentioning
slight change in `erc-channel-user' accessor behavior.
* lisp/erc/erc-common.el (erc-channel-user): Change type for status slot
to natnum from integer.
* lisp/erc/erc.el (erc-channel-user-signal-if-status-unknown): New
variable.
(erc--define-channel-user-status-compat-getter): Only use fallback in
Non-ERC buffers because "obviously" a status flag is unusable if the
server doesn't advertise it or, rather, advertises nonsupport via its
absence. This regression was introduced in ERC 5.6.
(erc-channel-begin-receiving-names): Sharp-quote function name.
(erc--get-prefix-flag): Mention in doc that a return value of nil can
also mean the status flag is not supported by the server.
* test/lisp/erc/erc-tests.el (erc--parsed-prefix): Show that it returns
nil in a non-ERC buffer.
(erc-tests--make-combinations)
(erc-tests--with-channel-user-status-accessors): New functions.
(erc-channel-user/status-accessors/solo/default)
(erc-channel-user/status-accessors/solo/ov)
(erc-channel-user/status-accessors/multi/default)
(erc-channel-user/status-accessors/multi/ov): New tests.
(Bug#67220)
* src/xfaces.c (face_inheritance_cycle): New function.
(Finternal_set_lisp_face_attribute): Signal an error if the
':inherit' attribute of a face is modified in a way that will
cause it to inherit from itself. (Bug#79672)
* test/src/xfaces-tests.el (xfaces-test-circular-inheritance): New
test.
* etc/NEWS: Announce the incompatible change.
* test/lisp/time-stamp-tests.el (time-stamp-test): New macro.
Use it to coalesce the repetitive lines of the various
time-stamp-format-* tests, reducing the line count of the
time-stamp-string formatting tests by 30%.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el
(erc-scenarios-keep-place-indicator--follow):
* test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp):
* test/lisp/erc/erc-tests.el (erc--channel-modes): Use "EMACS_EMBA_CI"
for EMBA-specific test selection instead of "CI", which is a Gitlab
"predefined" variable absent from .job-template's Docker subprocess.
Omit newlines and other stray chars, such as "^G", from log output when
running tests for ERC non-interactively.
* test/lisp/erc/erc-match-tests.el (erc-add-entry-to-list, erc-pals)
(erc-fools, erc-keywords, erc-dangerous-hosts): Make `inhibit-message'
non-nil when `noninteractive'.
* test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic): Make
`inhibit-message' non-nil when `noninteractive'.
* test/lisp/erc/erc-scenarios-base-buffer-display.el
(erc-scenarios-base-buffer-display--interactive-default): Make
`inhibit-message' non-nil when `noninteractive'.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-prompt): Make `inhibit-message' non-nil when
`noninteractive'.
* test/lisp/erc/erc-services-tests.el (erc-nickserv-get-password): Make
`inhibit-message' non-nil when `noninteractive'.
* test/lisp/erc/erc-stamp-tests.el (erc-timestamp-intangible--left):
Make `inhibit-message' non-nil when `noninteractive'.
* test/lisp/erc/erc-tests.el (erc-cmd-UNIGNORE, erc-hide-prompt)
(erc--check-prompt-input-for-excess-lines, erc-select-read-args, erc-tls)
(erc--interactive, erc-server-select): Make `inhibit-message' non-nil
when `noninteractive'.
(erc--modify-local-map): Inhibit call to `ding' because it inserts an 07
char, which shows up in the test result logs.
So far, 'scope-elisp-analyze-form' would disable
'read-symbol-shorthands' while reading a source form in
order to obtain the "original" length of symbols and pass
that length to the callback called for each analyzed symbol.
However, 'scope-elisp-analyze-form' could report an
incorrect length when a symbol was written with redundant
escaping (e.g. 'f\oo'). Moreover, disabling
'read-symbol-shorthands' breaks macro-expansion during
analysis, because macros may expect "expanded" symbols,
without shorthands.
In this commit we address these issues by leaving
'scope-elisp-analyze-form' enabled (so we get expended
symbols for macro-expansion) and recovering the original
length lazily in the callback, if needed, by going to the
beginning of the symbol and searching forward for its end.
* lisp/emacs-lisp/elisp-scope.el (elisp-scope--report):
Replace LEN argument with SYM, the analyzed symbol itself.
Adapt all callers.
(elisp-scope-analyze-form): Cease let-binding
'read-symbol-shorthands' to nil while reading. Wrap
analysis in 'save-excursion' when reading from current
buffer. Update docstring.
* lisp/progmodes/elisp-mode.el (elisp-local-references)
(elisp-fontify-symbol): Obtain symbol length from buffer.
* test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el:
Add test that incorporates 'read-symbol-shorthands'.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-test-font-lock):
Set up 'read-symbol-shorthands' in test file.
The test works when run interactively and in batch mode started from
a terminal, but not from M-x compile.
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Disable on macOS when TERM=dumb.