Commit graph

8879 commits

Author SHA1 Message Date
Rahul Martim Juliato a8736d5f88 Improve where the replacement is previewed (bug#81583)
* lisp/replace.el (replace-preview--input): New function.
(replace-preview-update): Add optional START and END, and
preview only the matches between them.
(replace-preview-setup): Accept a nil FROM, read from the
minibuffer along with the replacement, and add optional
BACKWARD.  Limit the preview to the part of the buffer that the
replacement will cover.
(query-replace-read-to): Add optional BACKWARD and pass it on.
(query-replace-read-args): Preview the replacement while reading
FROM as well, and preview nothing when the caller asks for no
highlighting.
* lisp/isearch.el (isearch-query-replace): Pass BACKWARD to
`query-replace-read-to'.
* test/lisp/replace-tests.el (replace-tests--preview): Add START
and END.
(replace-tests-preview-bounds, replace-tests-preview-input): New
tests.
* doc/emacs/search.texi (Replace): Document the above.
2026-09-09 20:54:04 +03:00
Rahul Martim Juliato 92acd66831 Use short symbols for query-replace-show-preview (bug#81583)
* lisp/replace.el (query-replace-show-preview): Accept the
symbols `replacement-only' and `both'.  Update the :type
accordingly, which also fixes the name of a function that does
not exist.
(query-replace-preview-match): Update the doc string.
(replace-preview-both, replace-preview-replacement-only): Say
which value of the option calls them.
(replace-preview--format): Dispatch on the new values, and still
call a function value.
(replace-preview-setup): Test the option for non-nil instead of
testing it with `functionp'.
* test/lisp/replace-tests.el (replace-tests--preview)
(replace-tests-preview-both, replace-tests-preview-cleanup)
(replace-tests-preview-disabled): Use the new values.
* doc/emacs/search.texi (Replace): Document the new values.
2026-09-09 20:53:55 +03:00
Roi Martin e33b54d938 Rename outline-xref' command to outline-find-headings'
* etc/NEWS: Update entry.
* lisp/outline.el (outline-mode-prefix-map, outline-mode-menu-bar-map):
Use `outline-find-headings'.
(outline-find-headings--fetch-xrefs): Rename from
`outline-xref--fetch-headings'.
(outline-find-headings--show-xrefs): Rename from
`outline-xref--show-xrefs'.
(outline-find-headings): Rename from `outline-xref'.
* test/lisp/outline-tests.el
(outline-tests--outline-find-headings-search-function): Rename from
`outline-tests--outline-xref-search-function'.
(outline-tests--outline-find-headings-regexp): Rename from
`outline-tests--outline-xref-regexp'.
(outline-tests--outline-find-headings-undefined): Rename from
`outline-tests--outline-xref-undefined'.  (Bug#81592)
2026-09-08 05:36:42 +03:00
Paul Eggert 89100e9c71 Port emacs-module-tests to Solaris 10
* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object):
Also allow a function name "_DYNAMIC" (Bug#81471).
2026-09-07 14:12:35 -07:00
Stefan Monnier 6c54097767 test/lisp/simple-tests.el (simple-tests--undo): Avoid continuing undo
Make sure the first 'undo' is not treated as the continuation of
some previous undo.
2026-09-07 14:12:58 -04:00
Sean Whitton 619a395916 VC-Dir: Fix error on `n' before "./" has appeared
If you typed `n' before "./" had appeared, Emacs signalled a
wrong-type-argument error.  Now it signals a better one.

* lisp/vc/vc-dir.el (vc-dir--before-dotname-p): Return nil if
the "./" entry hasn't appeared yet.
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test-vc-dir-next/previous): Simulate the problem case.

* lisp/emacs-lisp/ewoc.el (ewoc-goto-next): Signal a user-error
instead of a plain error.  This makes sense for all the current
call sites.  (This is secondary to the bug fix above: this code
was never reached, previously.)
2026-09-07 14:14:01 +01:00
Paul Eggert d418272f31 Port diff-mode-tests to POSIX diff
Do not assume that diff has the -a option, as POSIX does not
require it.  Problem found on Solaris 10 (bug#81480).
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock)
(diff-mode-test-font-lock-syntax-one-line)
(diff-mode-test-git-patch)
(diff-mode-test-git-patch/before-first-hunk)
(diff-mode-test-git-patch/signature):
Skip unless "diff -a" works.
2026-09-07 01:57:17 -07:00
Paul Eggert 0076b8df57 Port nsm-check-local-subnet-ipv4 test to Solaris 10
* test/lisp/net/nsm-tests.el (nsm-check-local-subnet-ipv4):
Don’t test the nsm-trust-local-network case when
network-interface-list reports no network interfaces.
On Solaris 10, network-interface-list always returns nil because
Solaris 10 lacks getifaddrs, and it’s not worth our trouble to
port network-interface-list to the hacky way this obsolescent OS
reports network interfaces (bug#81473).
2026-09-06 10:39:33 -07:00
Paul Eggert 8cfcc3cb00 Port tab-bar-tests to Solaris
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Test tty-type "linux" only on gnu/linux, as it may not exist
on other platforms, e.g., Solaris (bug#81477).
2026-09-06 10:19:10 -07:00
Eli Zaretskii a947231851 Port gcc-tests to Solaris 10’s GCC 3.4.3
Problem reported by Paul Eggert (Bug#81484).
* test/lisp/cedet/semantic/bovine/gcc-tests.el (semantic-gcc-test):
Do not assume GCC is version 4 or later.
(semantic-gcc-test/1, semantic-gcc-test/6): Update GCC version number.
* test/src/regex-emacs-tests.el (regex-tests-generic-line):
Read the test file in utf-8-unix.
2026-09-05 14:46:22 -07:00
Jim Porter 6b53a6f9e4 Use completion boundaries in 'pcomplete-long-option-completion-table'
This indicates that the current completion field is complete when the
string is, e.g. "--option=".  The option value is a subsequent field and
is handled by other parts of Pcomplete (bug#81792).

* lisp/pcomplete.el (pcomplete-long-option-completion-table): Set
boundary for completed options that take values.

* test/lisp/pcomplete-tests.el (pcomplete-shell-completion): Convert to
macro and accept BODY arguments.
(pcomplete-test-long-options/with-value/multiple)
(pcomplete-test-long-options/without-value/multiple): New tests.
2026-09-05 13:37:51 -07:00
Michael Albinus 5ebed5219d Adapt eglot tests on emba
* test/infra/Dockerfile.emba (emacs-eglot): Install rust-src.

* test/infra/gitlab-ci.yml (test-eglot): Extend EMACS_EXTRAOPT.

* test/lisp/progmodes/eglot-tests.el
(eglot-test-rust-completion-exit-function): Don't skip on emba.
2026-09-04 17:50:44 +02:00
Helmut Eller 1d07d02a75 Improve undo-in-region support for combine-change-calls
* lisp/subr.el (combine-change-calls-1): Use the new 'apply entry
variant for the buffer-undo-list.
(undo--wrap-and-run-primitive-undo): Adjust the undo entries if the
region has moved.
* test/src/undo-tests.el (undo-test-combine-change-calls-4): New test.
2026-09-04 09:38:01 +02:00
Helmut Eller 15aa8dd49f Improve undo-in-region support for diff-unified->context
* lisp/vc/diff-mode.el (diff-unified->context, diff-context->unified):
Use the new 'apply variant for buffer-undo-list entries.
2026-09-04 09:25:24 +02:00
Helmut Eller cb1be3124c Improve undo-in-region for 'apply entries
This patch adds a new variant of 'apply entries for the undo list of the
form: (apply DELTA (BEG . END) FUN-NAME . ARGS).

This similar to the existing (apply DELTA BEG END FUN-NAME . ARGS)
variant.  The difference for the new variant is that FUN-NAME is applied
to the adjusted BEG and END arguments together with ARGS.  This allows
functions to compute positions relative to the adjusted region.

The existing 'apply entry variants remain supported for backward
compatibilty.

* lisp/simple.el (primitive-undo): Call the function for the new 'apply
variant with START and END.
(undo-elt-in-region, undo-adjust-elt, undo-delta): Add support for the
new 'apply entries.
* test/src/undo-tests.el (undo-tests-selective-apply-1)
(undo-tests-selective-apply-2): New tests.
(undo-tests--mark-region, undo-tests--selective-apply)
(undo-tests--undo-delete, undo-tests--undo-insert)
(undo-tests--adjust-markers): New helpers.
2026-09-04 09:24:49 +02:00
Sean Whitton ab1d6868ed Improve presentation of query-replace-show-preview
* doc/emacs/search.texi (Replace):
* etc/NEWS:
* lisp/replace.el (query-replace-show-preview): Docs
improvements.
(replace-preview-only-replacement): Rename ...
(replace-preview-only-replacement): ... to this.  All uses
changed.
2026-09-03 11:42:04 +01:00
Sean Whitton 1d64554f99 Merge from origin/emacs-31
6f230503c8 ; * admin/make-tarball.txt: Don't use a batch process for...
5fdb5e3485 Relax formatting requirements on NEWS when converting to ...
fe4b9df4f4 Adjust generating HTML for historic NEWS
30b2265a01 ; * admin/make-tarball.txt: Publish HTML formatted NEWS.
99f8ed8d46 make-news-html-file: Don’t assume NEWS has local variables
5c5362a3e8 Escape [[ in NEWS when generating HTML via Org
9794fa0d5d elisp-scope.el: Avoid excessive 'trusted-content-p' calls
956875f822 ; * test/lisp/emacs-lisp/crm-tests.el: Fix copyright years.
e8b46219ca Fix choose-completion in CRM with boundaries
e420d0d978 ; Further explain WHEN argument to marking functions obso...
c4d50ea097 Skip all package-vc tests if git is not installed
2026-09-03 10:31:58 +01:00
Michael Albinus 05af306d27 ; Another attempt to fix filenotify-tests.el
* test/lisp/filenotify-tests.el (file-notify-test12-symlinks): Adapt test.
2026-09-03 08:15:04 +02:00
Rahul Martim Juliato 3b721dd39a Let 'query-replace-show-preview' be a function (bug#81583)
Suggested by Juri Linkov <juri@linkov.net>.

* lisp/replace.el (query-replace-show-preview): Drop the values
t and 'both' in favor of the two functions that implement them.
(query-replace-preview-match): Doc fix.
(replace-preview-propertize): Rename from
'replace-preview--propertize' and make it public, so that the
preview functions can be copied and adapted.
(replace-preview-only-replacement, replace-preview-both): New
functions.
(replace-preview--format): Call the value of
'query-replace-show-preview'.
(replace-preview-setup): Preview only if the value is a
function.
* etc/NEWS: Update the entry.
* doc/emacs/search.texi (Replace): Document the new values.
* test/lisp/replace-tests.el (replace-tests--preview)
(replace-tests-preview-cleanup, replace-tests-preview-disabled)
(replace-tests-preview-invisible-match): Use the new functions.
(replace-tests-preview-both, replace-tests-preview-function):
New tests.
2026-09-02 22:01:58 +03:00
Spencer Baugh 9f5285398b Repeated TAB scrolls Completions only if it doesn't complete
* lisp/minibuffer.el (completion--attempt-state): Add.
(completion--in-region-1): Don't scroll if the minibuffer has
changed since the last TAB. (bug#81578)
* test/lisp/minibuffer-tests.el
(completion-tab-with-completions-visible-bug81578): New test.
2026-09-02 20:47:09 +03:00
Michael Albinus 9b85f1e6bd ; Fix last change
* test/lisp/filenotify-tests.el (file-notify-test12-symlinks): Adapt test.
2026-09-02 18:54:37 +02:00
Michael Albinus 397fcd24d2 ; * test/infra/gitlab-ci.yml (test-eglot): Fix EMACS_EXTRAOPT. 2026-09-02 18:03:03 +02:00
Michael Albinus 6117772c77 ; * test/infra/gitlab-ci.yml (test-eglot): Fix EMACS_EXTRAOPT. 2026-09-02 12:18:58 +02:00
Dmitry Gutov a1bb496e24 (vc-test-vc-dir-next/previous): Fix the test
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test-vc-dir-next/previous): Fix the test.
2026-09-01 20:07:03 +03:00
Sean Whitton 956875f822 ; * test/lisp/emacs-lisp/crm-tests.el: Fix copyright years. 2026-09-01 17:14:03 +01:00
Aaron L. Zeng e8b46219ca Fix choose-completion in CRM with boundaries
* lisp/emacs-lisp/crm.el (crm--choose-completion-string):
Delete.
(completing-read-multiple): Set buffer-local
completion-no-auto-exit instead of using
choose-completion-string-functions.  Do not set
completion-list-insert-choice-function.  (Bug#81411)

* test/lisp/emacs-lisp/crm-tests.el: New file.
2026-09-01 17:13:41 +01:00
Michael Albinus ac54527fad Improve eglot tests on emba
* test/infra/Dockerfile.emba (emacs-eglot): Don't run 'pipx ensurepath'.

* test/infra/gitlab-ci.yml (test-eglot): Adapt EMACS_EXTRAOPT.
2026-09-01 15:50:35 +02:00
Michael Albinus ab80254e01 ; Remove traces in filenotify-tests.el
* test/lisp/filenotify-tests.el (file-notify-test07-many-events)
(file-notify-test08-backup): Remove traces.
2026-09-01 11:54:11 +02:00
Michael Albinus 21d0f8023a Improve handling of pending file notification events
* lisp/filenotify.el (file-notify--check-pending-rename): New defun.
(file-notify--handle-event): Use it.  Start a timer checking
pending events.  (Bug#81531)

* test/lisp/filenotify-tests.el (file-notify--test-with-actions):
Read pending event.
(file-notify-test05-file-validity, file-notify-test12-symlinks):
Adapt tests.
(file-notify-test13-unmount): Rename.
2026-09-01 09:58:34 +02:00
Lockywolf 476200e4dd Fix ispell-tests issues discovered on Solaris 10
* lisp/textmodes/ispell.el: Export minimum versions for engines.
(ispell--minversion-alist): Define versions alist.
(ispell-check-version): Use public version alist.
* test/lisp/textmodes/ispell-tests/ispell-tests-common.el:
(ispell-tests--parse-v): Parse engine versions.
(ispell-tests--valid-version-triple?): Add version verification.
(ispell-tests--broken-system?): Add predicate for excluding broken
systems.
*test/lisp/textmodes/ispell-tests/ispell-aspell-tests.el
(ispell/aspell/ispell-check-version/works)
(ispell/aspell/ispell-word/english/correct)
(ispell/aspell/ispell-word/english/incorrect):
* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-valid-dictionary-list/aspell): Add Aspell triple check.
(ispell/ispell-pdict-save/unmodified)
(ispell/ispell-lookup-words/simple)
(ispell/ispell-complete-word/ispell-completion-at-point): Disable
on Solaris.  (Bug#81472)
2026-08-31 14:58:14 +03:00
Michael Albinus 45ff5fd4dc * test/infra/gitlab-ci.yml (test-eglot): Set $PATH. 2026-08-31 09:34:31 +02:00
Paul Eggert bbcc216395 Port xref-tests to pre-POSIX.1-2024
lisp/progmodes/xref.el assumes xref -0 works, but this is not true
on some platforms like Solaris 10.  xref -0 was not standardized
until POSIX.1-2024, and there is little point to failing the tests
on older platforms.  (bug#81479)
* test/lisp/progmodes/xref-tests.el (xref-tests--xargs-0-works):
New constant.
(xref-tests--deftest): New macro.  All tests changed to use this
macro rather than using plain ert-deftest.
2026-08-30 16:44:06 -07:00
Philip Kaludercic c4d50ea097 Skip all package-vc tests if git is not installed
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-test-deftest): Inject a 'skip-unless' at the
beginning of the test definition to check if "git" is installed,
as we test package-vc using vc-git.  (Bug#81470)
2026-08-30 14:15:32 -07:00
Michael Albinus 98165ff73e Install more test server for eglot tests on emba
* test/infra/Dockerfile.emba (emacs-eglot): Install pipx,
rassumfrassum, ruff and ty.
2026-08-30 16:36:30 +02:00
Jim Porter 6723797856 Don't add trailing space when completing options that take arguments
The space is unhelpful, since the user likely wants to add a value for
that option immediately after the "=" (bug#81689).

* lisp/pcomplete.el (pcomplete-long-option-completion-table): New
function...
(pcomplete-here-using-help):
* lisp/pcmpl-gnu.el (pcomplete/tar):
* lisp/pcmpl-linux.el (pcomplete/systemctl): ... use it.

* test/lisp/pcomplete-tests.el (pcomplete-shell-completion)
(pcomplete/pcmpl-option-test): New functions.
(pcomplete-test-long-options/with-value)
(pcomplete-test-long-options/without-value): New tests.
2026-08-29 10:15:06 -07:00
Eli Zaretskii 84c500552e Merge from origin/emacs-31
c0b872dd67 ; * admin/notes/jargon: Add FUD.
e8936794ad Fix navigating *Completions* with TAB in vertical format
9c9a26e60b Merge branch 'emacs-31' of git.savannah.gnu.org:/srv/git/...
3d9f0fa865 ; * admin/make-tarball.txt: Note about publishing NEWS (b...
bcfc4e7e19 tab-bar-tests-quit-restore-window: Mark unstable
a001a45a50 Revert "Delete test that hangs"
6800426743 admin/make-manuals: Include type hierarchy auxiliary files
a013cdd3e8 ; * admin/make-tarball.txt: Various improvements.
2026-08-29 07:17:49 -04:00
Sam James a746f6d7e7 uuid: fix test override of 'float-time'
The mock 'float-time' was defined to take no arguments, unlike the
real 'float-time', which manifested as a test failure in
'uuid-v7-generator-known-rnd-and-ts'.

* test/lisp/emacs-lisp/uuid-tests.el (uuid-v7-generator-known-rnd-and-ts):
Fix mock 'float-time' definition.  (Bug#81701)
2026-08-26 15:32:12 +03:00
Roi Martin e156410d30 Add button to diff failed erts-file test output in ERT
* doc/misc/ert.texi (Running Tests Interactively): Mention diff button.
* etc/NEWS: Add entry.
* lisp/emacs-lisp/ert.el (ert--erts-file-test-execution-observer): Add
docstring.
(ert--erts-file-test-description, ert--erts-file-test-mismatch): New
structures.
(ert--erts-file-test-diff-button): New button type.
(ert--erts-file-test-diff-button-action): New function.
(ert-results-pop-to-erts-file-tests-for-test-at-point): Mention diff
button in docstring.
(ert-test--erts-test): Use `ert--erts-file-test-description' and
`ert--erts-file-test-mismatch' structures.
* test/lisp/emacs-lisp/ert-resources/erts-fail-point.erts (Name): New
test file.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-list-of-erts-file-tests):
Use `ert--erts-file-test-description' structure.
(ert-test-erts-file-test-output-mismatch): New test.  (Bug#81685)
2026-08-26 14:17:41 +02:00
Michael Albinus 57ad5ab8f7 Sync with Tramp 2.8.3-pre (don't merge)
* doc/misc/tramp.texi (Auto-save File Lock and Backup): Adapt example.

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.8.3-pre".

* lisp/net/tramp-cmds.el (tramp-file-name-with-sudo): Expand the
result for consistency.  (Bug#81622)

* lisp/net/tramp.el (with-tramp-progress-reporter):
Let-bind `inhibit-message'.
(tramp-file-name-for-operation): Fix the case, that the first
argument is a process name.
(tramp-handle-find-backup-file-name): Use connection-local value
of `make-backup-files'.

* test/lisp/net/tramp-tests.el (tramp-test38-find-backup-file-name):
Extend test.
2026-08-25 10:22:03 +02:00
Stephen Berman e8936794ad Fix navigating *Completions* with TAB in vertical format
* lisp/simple.el (next-line-completion): Make using TAB to
navigate in vertical format cycle through the minibuffer (bug#81631).

* test/lisp/minibuffer-tests.el (completion-auto-select-test-bug81635):
Run tests for all values of 'completions-format'.
2026-08-25 09:52:44 +02:00
Sean Whitton 3b2dbae103 Merge from origin/emacs-31
bcfc4e7e19 tab-bar-tests-quit-restore-window: Mark unstable
2026-08-24 13:42:13 +01:00
Sean Whitton bcfc4e7e19 tab-bar-tests-quit-restore-window: Mark unstable
* test/lisp/tab-bar-tests.el
(tab-bar-tests-quit-restore-window): Mark unstable.
2026-08-24 13:41:29 +01:00
Sean Whitton a001a45a50 Revert "Delete test that hangs"
This reverts commit 76846eede3.

Do not merge to master.
2026-08-24 13:40:41 +01:00
Sean Whitton 6a8c1253dd Merge from origin/emacs-31
249e293f7a em-script-tests: don't load the site file
442674babb emacsclient-tests: don't load the site file
b4612c6f29 Fix navigating vertical completions with annotations (bug...
f60d4243e6 Fix 'describe-package' for the Emacs pseudo package
d3229f9f37 Avoid errors in text-only client frames of PGTK build
2026-08-24 11:29:00 +01:00
Sean Whitton 76846eede3 Delete test that hangs
* test/lisp/tab-bar-tests.el
(tab-bar-tests-quit-restore-window): Delete test that hangs, for
the Emacs 31.1 release.  Do not merge to master.
2026-08-24 10:05:22 +01:00
Ulrich Müller 249e293f7a em-script-tests: don't load the site file
* test/lisp/eshell/em-script-tests.el (em-script-test/batch-file)
(em-script-test/batch-file/shebang): Invoke Emacs with -Q to
suppress site file loading.  (Bug#81679)
2026-08-23 21:00:56 +02:00
Ulrich Müller 442674babb emacsclient-tests: don't load the site file
* test/lib-src/emacsclient-tests.el
(emacsclient-test-alternate-editor-allows-arguments)
(emacsclient-test-alternate-editor-allows-quotes): Invoke the
alternate editor with -Q to suppress site file loading.  (Bug#81676)
2026-08-23 21:00:56 +02:00
Divya Ranjan 6ae70bc02e Skip canvas tests if the image type is not available
* test/src/emacs-module-tests.el: skip canvas tests if the
image type is not available
2026-08-22 17:07:50 +02:00
Michael Albinus 03793610f7 Adapt filenotify test
* test/lisp/filenotify-tests.el
(file-notify-test10-move-file-to-another-watched-dir): Adapt test.
2026-08-22 12:24:26 +02:00
Eli Zaretskii 2b2ee936a6 Merge from origin/emacs-31
61700f9dd6 Fix TAB to wrap with completion-auto-select t
2026-08-22 05:09:50 -04:00