* lisp/vc/vc-dir.el (vc-dir-resynch-file): Pass only truenames
to vc-dir-recompute-file-state.
* test/lisp/vc/vc-tests/vc-test-misc.el (vc-git): Require.
(vc-test-vc-dir-on-symlink): New test.
This is necessary to correctly read keys like 'M-~'
used by 'save-some-buffers' that is two keys 'ESC ~'
on a tty.
* doc/lispref/minibuf.texi (Multiple Queries):
Index 'y-or-n-p-use-read-key' for 'map-y-or-n-p'.
Mention using a key sequence instead of single keys.
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
In the 'y-or-n-p-use-read-key' cond-branch,
use 'read-key-sequence-vector' instead of 'read-key'.
In the default cond-branch, use 'this-command-keys-vector'
instead of 'last-command-event'. In both cond-branches
use 'key-description' instead of 'single-key-description'
(bug#81168).
Instead of '(eq def nil)' check if chars are either nil
or an empty vector in noninteractive mode (bug#67836).
* test/lisp/emacs-lisp/map-ynp-tests.el (test-map-ynp-kmacro):
Test separately nil/non-nil 'y-or-n-p-use-read-key'.
(test-map-ynp-keys): New test for complete coverage of
'map-y-or-n-p'.
* lisp/erc/erc-goodies.el (keep-place-indicator): Add
`erc-keep-place-indicator-arrow' face to overlay arrow.
* lisp/erc/erc-stamp.el (erc-stamp--display-prompt-in-left-margin)
(erc--conceal-prompt): Add `erc-prompt-face' to entire `left-margin'
string. See also 9ba65aa9 "Fix missing margin face on display prop in
erc-stamp".
* test/lisp/erc/erc-fill-tests.el (erc-fill--left-hand-stamps): Update
expected text properties on prompt. (Bug#80693)
* lisp/textmodes/fill.el (fill-paragraph): Handle the case
when a non-comment line follows a comment line with
non-nil 'fill-paragraph-handle-comment' (bug#80449).
Skip such a comment line before filling a non-comment line.
* test/lisp/textmodes/fill-tests.el
(fill-test-fill-paragraph-handle-comment): Add new test.
* test/lisp/textmodes/fill-resources/fill-paragraph-handle-comment.erts:
New file.
More context in Bug#80786 and:
https://lists.gnu.org/archive/html/emacs-orgmode/2026-03/msg00286.html
`icalendar-recur' as a type name for RRULE values was confusing and made
the accessors for this type difficult to discover, because `icalendar-recur-'
is also used as a prefix in icalendar-recur.el. This change renames the
`icalendar-recur' type to `icalendar-rrule-value' and renames the
accessor functions for these values appropriately.
* lisp/calendar/icalendar-parser.el: Rename symbols as follows:
(icalendar-recur): `icalendar-rrule-value'
(icalendar-read-recur-rule-part): `icalendar-read-rrule-part'
(icalendar-print-recur-rule-part): `icalendar-print-rrule-part'
(icalendar-recur-rule-part): `icalendar-rrule-part'
(icalendar-read-recur): `icalendar-read-rrule-value'
(icalendar-print-recur): `icalendar-print-rrule-value'
(icalendar--recur-value-types): `icalendar--rrule-value-types'
(icalendar-recur-value-p): `icalendar-rrule-value-p'
(icalendar-recur-freq): `icalendar-rrule-freq'
(icalendar-recur-interval-size): `icalendar-rrule-interval-size'
(icalendar-recur-until): `icalendar-rrule-until'
(icalendar-recur-count): `icalendar-rrule-count'
(icalendar-recur-weekstart): `icalendar-rrule-weekstart'
(icalendar-recur-by*): `icalendar-rrule-by*'.
(icalendar-rrule):
(icalendar-index-insert):
(icalendar-index-get): Update references.
* lisp/calendar/icalendar-recur.el (icalendar-recur-find-interval):
(icalendar-recur-nth-interval):
(icalendar-recur-next-interval):
(icalendar-recur-previous-interval):
(icalendar-recur-refine-from-clauses):
(icalendar-recur-recurrences-in-interval):
(icalendar-recur-recurrences-in-window):
(icalendar-recur-recurrences-to-count):
(icalendar-recur-tz-observance-on): Update references.
* lisp/calendar/diary-icalendar.el: Update references.
* lisp/calendar/icalendar-shortdoc.el (icalendar): Update shortdoc examples.
* lisp/gnus/gnus-icalendar.el: Update references.
* test/lisp/calendar/diary-icalendar-tests.el:
* test/lisp/calendar/icalendar-parser-tests.el:
* test/lisp/calendar/icalendar-recur-tests.el: Update references in tests.
* lisp/erc/erc-stamp.el (erc-insert-timestamp-right): Explicitly add
face to right-hand stamp's `display' margin string. Commit d24b10ca
"Introduce 'margin' face for window margin background" did away with the
"fall-through" behavior in which a margin spec's string that lacks its
own face property inherited whatever the associated `display' char
happened to have. (Bug#80693)
;; The old language in "(elisp) Display Margins" said "if the
;; string to be displayed in the margin doesn't specify a face, its
;; face is determined using the same rules and priorities as it is
;; for strings displayed in the text area (see Displaying Faces),"
;; and that "if this results in undesirable 'leaking' of faces into
;; the margin, make sure the string has an explicit face specified
;; for it." It seems ERC and likely more than a few other packages
;; never came to heed this guidance and have erroneously depended
;; on such behavior for years if not decades.
;;
;; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld:
;; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld:
;; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld:
;; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld:
;; * test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update
;; snapshot.
All tests now use 'jsonrpc--with-python-fixture' with a Python3
subprocess instead of the in-Emacs TCP server. Changed the "harakiri"
method to be a request instead of a notification for to reduce chance of
"Sentinel hasn't run" warning.
The two in-Emacs-RPC-specific error tests ('errors-with--32601' and
'signals-an--32603-JSONRPC-error') are dropped with the fixture itself,
as the error paths they exercise are internal to the Emacs Lisp
dispatcher and have no direct Python equivalent. They will have to be
re-done later on in other form.
* test/lisp/jsonrpc-resources/server-emacsrpc.py: New file.
* test/lisp/jsonrpc-resources/server-anxious-nested.py: Use new
harakiri.
* test/lisp/jsonrpc-resources/server-emacsrpc.py: Use new harakiri.
* test/lisp/jsonrpc-resources/server-harakiri.py: Use new harakiri.
* test/lisp/jsonrpc-resources/server-remote-during-sync-1.py: Use new
harakiri.
* test/lisp/jsonrpc-resources/server-remote-during-sync-2.py: Use new
harakiri.
* test/lisp/jsonrpc-resources/server-remote-error.py: Use new harakiri.
* test/lisp/jsonrpc-resources/common.py (harakiri): New definition.
* test/lisp/jsonrpc-tests.el
(jsonrpc--with-python-fixture): Rework, move up.
(jsonrpc-connection-ready-p): Move up.
(jsonrpc--call-with-emacsrpc-fixture)
(jsonrpc--with-emacsrpc-fixture)
(errors-with--32601)
(signals-an--32603-JSONRPC-error): Remove.
(returns-3, times-out, doesnt-time-out, stretching-it-but-works)
(deferred-action-toolate, deferred-action-intime)
(deferred-action-complex-tests): Migrate to Python fixture.
(scontrol-remote-during-sync-1, scontrol-remote-during-sync-2)
(scontrol-anxious-nested, scontrol-remote-error)
(shutdown-clean-after-notification): Tweak.
* lisp/net/tramp.el (tramp-unquote-shell-quote-argument): Do not
expand remote file names w/o a localname.
* test/lisp/net/tramp-tests.el
(tramp--test-supports-environment-variables-p): New defun.
(tramp-test33-environment-variables): Use it.
These will be resubmitted as patches for review.
Revert "Repair another test bollixed by aggressive optimization."
This reverts commit 47735e0243.
Revert "Repair ab ecal test by making a variable kexical,"
This reverts commit ca42055b0c.
Revert "Complete the test set for floatfns,c."
This reverts commit 1b0c8d6b95.
Revert "Tesrts for the portable primitives in fileio.c."
This reverts commit a339c6827c.
Revert "Tests for primitives in coding.c and charset.c."
This reverts commit 5749b2e4f4.
Revert "Tests for primitives from the character.c module."
This reverts commit b09f8df206.
Revert "Tests for the lreaf.c amd print.c primitives."
This reverts commit d7a3d442b4.
Revert "Tests for remaining functions iun eval.c."
This reverts commit cd038e5617.
Revert "Completing test coverage for dataa.c orimitives."
This reverts commit a6e19d6179.
Revert "More correctness tesrs for orinitives from fns.c."
This reverts commit 40ff4512ad.
Revert "More tests for edit functions, buffers, and markers."
This reverts commit 67e8f87562.
Revert "Added more buffer/marker/editing test coverage."
This reverts commit 3dda4b85e8.
Revert "Category/charset/coding + char-table tests."
This reverts commit 7a93a7b334.
Revert "More test coverage improvements."
This reverts commit fc7339c46d.
Revert "More test coverage improvements."
This reverts commit 95329bf445.
Revert "More test coverage improvements for ERT."
This reverts commit e42c579a54.
Revert "Crrections to tedt coverrage extensuion after bootstrap build."
This reverts commit 90af3295c7.
Revert "Improve test coverage of builtin predicates."
This reverts commit 6eb170b007.
Revert "Tests for 2 marker primitives previously not covered."
This reverts commit 6d7f0acf9c.
Revert "Tests for 7 editor primitives previously not covered."
This reverts commit bb403e70ae.
In terminal sessions, SIGINT is turned into a `quit` ELisp signal,
but in batch it has traditionally killed Emacs. It can be very
useful to cause a `quit` from outside the process when running
in batch (e.g. for "batch" sessions that provide a REPL via stdin/out),
so add a new var 'kill-emacs-on-sigint' to control that behavior.
(bug#80942)
* src/keyboard.c (handle_interrupt_signal): Obey `kill_emacs_on_sigint`.
(init_keyboard): Use `deliver_interrupt_signal` for SIGINT also for
batch sessions.
(syms_of_keyboard): New variable `kill_emacs_on_sigint`.
* test/src/keyboard-tests.el (keyboard-sigint-to-quit): New test.
* doc/emacs/cmdargs.texi (Initial Options): Mention the effect of
`kill-emacs-on-sigint` in batch mode.
Most of these tests are for the scontrol/"anxious continuation"
mechanism (bug#80623)
The new ERT tests use Python subprocesses via stdin/stdout pipe as
JSONRPC endpoints. A shared framing library lives in
jsonrpc-resources/common.py.
* test/lisp/jsonrpc-tests.el (jsonrpc--test-dir): New constant.
(jsonrpc--with-python-fixture): New macro.
(scontrol-remote-during-sync-1)
(scontrol-remote-during-sync-2)
(scontrol-anxious-nested)
(scontrol-remote-error)
(shutdown-clean-after-notification): New tests.
* test/lisp/jsonrpc-resources/common.py: New file.
* test/lisp/jsonrpc-resources/server-remote-during-sync-1.py: New file.
* test/lisp/jsonrpc-resources/server-remote-during-sync-2.py: New file.
* test/lisp/jsonrpc-resources/server-anxious-nested.py: New file.
* test/lisp/jsonrpc-resources/server-remote-error.py: New file.
* test/lisp/jsonrpc-resources/server-harakiri.py: New file.
* etc/ERC-NEWS: Add entry for option `erc-log-insert-log-on-open'.
Mention deprecation of `erc-log-setup-logging'.
* lisp/erc/erc-log.el (erc-log-insert-log-on-open): Expand type from
boolean to choice of boolean, predicate, and new function item
`erc-log-new-target-buffer-p'.
(erc-log-mode, erc-log-enable, erc-log-disable): Replace
`erc-log-setup-logging' on `erc-connect-pre-hook' with
`erc-log--insert-log-on-open' at depth 80. Replace calls to
`erc-log-setup-logging' with ones to `erc-log--setup'.
(erc-log-new-target-buffer-p): New function. While the name could
perhaps do more to indicate that it's only useful when called from
`erc-open', that's the only place ERC typically sets up new target
buffers.
(erc-log-setup-logging): Deprecate and replace body with adapter that
calls `erc-log--setup' and `erc-log--insert-log-on-open'.
(erc-log--setup): New function whose body is mostly from the
"nondestructive" portion of `erc-log-setup-logging'. Instead of moving
the `erc-saved-last-position' marker to the old value, expect it not to
have been initialized by `erc-initialize-log-marker' because
`erc-connect-pre-hook' now runs after this code, which is now
incorporated more judiciously into the module's "enable body".
(erc-log--insert-log-on-open): New function whose body is mostly from
the "destructive" portion of the previous incarnation of
`erc-log-setup-logging'. Unlike the original, if option
`erc-log-insert-log-on-open' is a function, call it to decide whether to
insert a log file atop its buffer. Also, don't advance the marker
`erc-last-saved-position' to the prompt area, where it can get stuck and
prevent logs from being saved when `erc-log-insert-log-on-open' is
non-nil. Thanks to Libera user Lionyx for reporting the bug, which has
been around since at least ERC 5.4 and Emacs 28.1.
(erc-log-disable-logging): Remove `erc-save-buffer-in-logs' from
`write-file-functions' to undo its buffer-local addition in what is now
`erc--log-setup'.
* test/lisp/erc/erc-scenarios-log-options.el: New file. (Bug#79665)
* lisp/erc/erc-log.el (erc-log-setup-logging): Restore
`erc-last-saved-position' from previous session. By default, a
non-/QUIT disconnect does not write out any remaining buffer text to
logs, instead leaving it until the buffer or Emacs is killed. But if a
successful reconnect occurs beforehand, the uncommitted portion must be
seen to somehow. Before this change, it would be lost because the
function `erc-initialize-log-marker' remakes the marker at the prompt
instead of recovering the previous value as now done here. Moreover,
the traditional workaround of customizing `erc-log-write-after-insert'
and `erc-log-write-after-send' to t should not be required to prevent
gaps in any decent IRC client.
* test/lisp/erc/erc-scenarios-log.el (erc-scenarios-log--reconnect): New
function.
(erc-scenarios-log--reconnect/auto, erc-scenarios-log--reconnect/manual):
New tests.
;; * test/lisp/erc/resources/join/reconnect/foonet-again.eld: Add QUIT.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el
(erc-scenarios-keep-place-indicator--follow): Intersperse more
`redisplay' calls to update the indicator's overlay.
* test/lisp/erc/erc-tests.el (erc-tests--assert-printed-in-subprocess):
Wrap CODE form in keyword sentinel.
(erc--find-mode, erc--essential-hook-ordering): Use modified interface.
(erc--find-group--real, erc--find-group/realistic): Rename former to
latter and run in subprocess.
(erc--update-modules/realistic): Redo to run in subprocess instead of
mocking.
* test/lisp/erc/resources/erc-d/erc-d-t.el
(erc-d-t-kill-related-buffers): Don't bother canceling
`erc-server-flood-timer', even in an actual ERC buffer, since
`erc-server-send-queue' first checks whether its BUFFER argument is
still live before sending anything to the process. Also, don't bother
collecting buffers only to immediately kill them.
* test/lisp/erc/resources/erc-d/erc-d.el (erc-d--filter): Always clear
remainder. Otherwise, partial emissions from the peer that aren't
terminated by a newline will confuse subsequent processing.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--run-in-term): Look for a library called
`erc-tests-compat', which ERC uses in its external CI to provide
compatibility shims of definitions too obscure or unfit for inclusion in
the Compat package on ELPA.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-kill-buffers): Also kill non-`erc-mode' buffers whose
names match a scheme used by ERC for work buffers. Allow for the
EXTRA-BUFFERS argument to possibly contain killed and null buffers.
* lisp/vc/vc-src.el (vc-src-register): Support "registering"
directories in FILES.
(vc-src-rename-file): Fix implementation and support renaming
directories.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file)
(vc-test-src-version-diff): Skip parts that don't work with SRC.
(Bug#80862)
If a host parser has some ranges, and an embedded parser also
has some ranges, the final range used by the embedded parser
should be an intersection of the two. This patch adds this
logic.
* lisp/treesit.el (treesit--range-verbose): New variable.
(treesit--intersect-ranges):
(treesit--set-embed-ranges): New function.
(treesit--update-ranges-non-local):
(treesit--update-ranges-local): Use the new functions.
* test/src/treesit-tests.el:
(treesit-intersect-ranges): New test.
* lisp/register.el (register--get-method-type): Refine the cl-generic hack
yet a but further.
* test/lisp/register-tests.el (register--jumpable-p): Fix the test.
* lisp/vc/vc-rcs.el (vc-rcs-register): Filter out directories from
FILES.
(vc-rcs-rename-file): Support OLD being a directory.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file)
(vc-test--rename-directory): Re-enable these tests for RCS.
(vc-test--rename-directory): Disable 'yes-or-no-p' questions that
RCS asks when it needs to create the RCS/ subdirectory: this lets
the test run without user interaction.
* lisp/treesit.el (treesit--range-start):
(treesit--range-end):
(treesit--flatten-ranges): New helpers.
(treesit-query-range):
(treesit-query-range-by-language): Don't flatten the ranges
returned by each range-fn.
(treesit--update-ranges-non-local):
(treesit--update-ranges-local): Handle the case where the range
is a complicated ((START . END)...).
* test/src/treesit-tests.el (treesit-range-helper): New test.
* lisp/vc/vc-hg.el (vc-hg-after-dir-status): Rewrite to handle
renames where the "R" line comes arbitrarily later in the
output.
* test/lisp/vc/vc-hg-tests.el
(vc-hg-test--after-dir-status-expect): New function.
(vc-hg-after-dir-status): New test.
* lisp/dired.el (dired--ls-accept-b-switch-p): New function.
(dired-internal-noselect): Use it in the condition on displaying
warning about filenames with newlines.
(dired--set-auto-toggle-b-switch): Use it to conditionalize
calling 'dired--toggle-b-switch'.
(dired-auto-toggle-b-switch, dired--toggle-b-switch): Improve doc
string.
* test/lisp/dired-tests.el (dired-test-filename-with-newline-1)
(dired-test-filename-with-newline-2): Skip unless Dired uses an
'ls' that supports the '-b' switch.
* etc/NEWS: Adjust accordingly the announcements of the Dired
warning and the new user option for file names with newlines.
* doc/misc/tramp.texi (Extension packages): Use another format
char in example.
(New operations): Document different argument types. Extend example.
* lisp/net/tramp.el: Use consequently `eq', `assq', `memq'.
(tramp-file-name-for-operation-external): Extend docstring.
(tramp-file-name-for-operation): Make more use of
`tramp-file-name-for-operation-external'.
(tramp-add-external-operation): New optional argument `arg-type'.
* test/lisp/net/tramp-tests.el (tramp--handle-test-operation):
Rename from `tramp--handler-for-test-operation'.
(tramp--handle-process-id)
(tramp--test-operation-file-name-for-operation): New defuns.
(tramp-test49-external-backend-function): Extend test.