1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-20 19:42:53 -08:00
Commit graph

8427 commits

Author SHA1 Message Date
Elías Gabriel Pérez
ef73f5c254 ; * lisp/progmodes/hideshow.el (hs-cycle): Fix regression. (Bug#79983)
* test/lisp/progmodes/hideshow-tests.el
(hideshow-cycle-with-delimiters)
(hideshow-cycle-without-delimiters)
(hideshow-check-unbalanced-parens): Add new tests.
2025-12-12 09:23:53 +02:00
Philip Kaludercic
665792f697
Handle remaining usages of 'package-vc-install-from-checkout'
* doc/emacs/package.texi (Fetching Package Sources): Remove
mention of `package-vc-install-from-checkout'.
* doc/misc/use-package.texi (Install package): Remove mention of
:vc in combination with :load-path.
* lisp/use-package/use-package-core.el (use-package-vc-install):
Suppress compile-time warning and generate warning during
evaluation instead.
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-checkout-from-elpa-install-from-checkout)
(package-vc-tests-checkout-with-git-install-from-checkout):
Suppress obsoletion warning.
2025-12-11 08:32:27 +01:00
Stephen Gildea
b969905a47 ; time-stamp: Prefer 'string-match-p' over 'string-match'
* lisp/time-stamp.el (time-stamp, time-stamp--system-name):
Use 'string-match-p' instead of 'string-match'.
(time-stamp--count-newlines): New function to implement the algorithm.
(time-stamp--system-name-1): New function, a testing seam.
* test/lisp/time-stamp-tests.el (with-time-stamp-system-name):  Use the
new testing seam to expand test coverage.
2025-12-10 13:00:31 -08:00
Przemysław Kryger
244dc6f15e Update email and rename packages and buffers in package-vc-tests
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-packages): Rename test packages to avoid
suffix being treated as a version number by
`package--description-file'.
(package-vc-tests-add): Ensure suffix capitalisation remains as
original when calling `replace-regexp-in-string'.
(package-vc-tests-create-repository): Fix typo in temporary
email and use a reserved TLD.
(package-vc-tests-environment-tear-down): Rename preserved
buffers to avoid conflicts between tests.
2025-12-09 16:10:20 +01:00
Przemysław Kryger
5731343ffe Update email in vc-tests and vc-git-tests
* test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo): Use
example.com, domain following RFC 2606.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--with-author-identity): Use example.com, domain
following RFC 2606.
2025-12-09 16:09:18 +01:00
Przemysław Kryger
777622682f Fix package-vc-tests
* lisp/emacs-lisp/package-vc.el (package-vc--make): Use same
format for buffer as `package-vc--build-documentation'.
* test/lisp/emacs-lisp/package-vc-tests.el
(message-auto-save-directory): Silence byte compiler.
(package-vc-with-tests-environment): Initialize package archives
after setting a temporary `package-user-dir'.  Set up
`package-gnupghome-dir'.  Remove `default-directory' binding.
(package-vc-tests-environment-tear-down): Fix argument order in
`package-vc-tests-log-buffer-name' call.
(package-vc-tests-with-installed): Rename from
`package-vc-with-installed-tests'.
(package-vc-test-deftest): Use
`package-vc-tests-with-installed'.
(prepare-patch): Bind `message-auto-save-directory' to
`package-vc-tests-dir'.
* test/lisp/package-vc-tests.el: Rename to
test/lisp/emacs-lisp/package-vc-tests.el
* test/lisp/package-vc-resources/Makefile.in: Rename to
test/lisp/emacs-lisp/package-vc-resources/Makefile.in
* test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX.texi.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX.texi.in
2025-12-08 18:48:09 +01:00
Elías Gabriel Pérez
a582f2bb57 hideshow: Deep cleaning. (Bug#79934)
This is just a refactoring change, simplifying most of the code
and commentaries and removing/deprecating redundant code.

* etc/NEWS: Announce changes.
* lisp/progmodes/hideshow.el (hs-hide-hook, hs-show-hook): Use
'defcustom' instead of 'defvar'.
(hs-block-end-regexp, hs-forward-sexp-function)
(hs-adjust-block-beginning-function)
(hs-adjust-block-end-function, hs-find-block-beginning-function)
(hs-find-next-block-function)
(hs-looking-at-block-start-predicate)
(hs-inside-comment-predicate): Update docstring.
(hs-discard-overlays): Simplify.
(hs-life-goes-on): Update docstring.
(hs-hideable-region-p): Revert previous changes.
(hs-overlay-at): Simplify.
(hs-make-overlay): Fix performance.
(hs-block-positions): Rework.
(hs--add-indicators): Fix performance.
(hs-isearch-show-temporary): Simplify.
(hs-looking-at-block-start-p): Rename ...
(hs-looking-at-block-start-p--default): ... to this.
(hs-forward-sexp, hs-hide-comment-region): Mark as obsolete.
(hs-hide-block-at-point): Rework.
(hs-get-first-block): Rename ...
(hs-get-first-block-on-line): ... to this.
(hs-inside-comment-p--default): Rework.
(hs-find-block-beginning): Rename ...
(hs-find-block-beg-fn--default): ... to this.
(hs-find-next-block): Rename ...
(hs-find-next-block-fn--default): ... to this.
(hs-hide-level-recursive): Rework.
(hs-find-block-beginning-match): Remove function.
(hs-already-hidden-p): Simplify.
(hs-c-like-adjust-block-beginning): Mark as obsolete.
(hs-hide-all, hs-show-all, hs-hide-block, hs-show-block)
(hs-hide-level, hs-hide-initial-comment-block, hs-cycle):
Simplify.
* test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1)
(hideshow-hide-level-2):
* test/lisp/progmodes/python-tests.el
(python-hideshow-hide-levels-3, python-hideshow-hide-levels-4):
* test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1)
(hideshow-hide-level-2):
* test/lisp/progmodes/python-tests.el
(python-hideshow-hide-levels-3, python-hideshow-hide-levels-4):
Update tests.
2025-12-08 09:20:29 +02:00
Przemysław Kryger
3b0dcb0b1b
Add tests for package-vc
* test/lisp/package-vc-tests.el
(package-vc-tests-preserve-artefacts): When non nil then
preserve temporary test files and buffers.
(package-vc-tests-dir, package-vc-tests-packages)
(package-vc-tests-repository): Silence byte compiler.
(package-vc-tests-packages): Define packages to test.
(package-vc-tests-add): Copy a an in file template, update
SUFFIX in it and add it to index.
(package-vc-tests-create-repository): Create a package git
repository with a test package's source.
(package-vc-tests-package-desc): Retrieve a `package-desc' for
tested package.
(package-vc-tests-package-spec): Retrieve a pkg-spec for tested
package.
(package-vc-tests-package-lisp-dir): Determine a lisp directory
for a package.
(package-vc-tests-package-main-file): Calculate expected
location of package's main file.
(package-vc-tests-load-history-marker): Create a load history
marker.
(package-vc-tests-load-history-pattern): Create a regexp pattern
to search in `load-history'.
(package-vc-tests-load-history-position): Calculate a position
in `load-history'.
(package-vc-tests-load-history-interesting-entries): Return
`load-history' entries related to the current
`package-vc-tests-dir'.
(package-vc-tests-explain-load-history-position): Return ERT
explanation for load history position failures.
(package-vc-tests-log-buffer-name): Return name of a log buffer
used to build package or its documentation.
(package-vc-tests-log-buffer-exists): Return non-nil when a log
buffer used to build package or its documentation exists.
(package-vc-tests-explain-log-buffer): Print contents of log
buffer used to build package or its documentation and return ERT
explanation for the failure.
(package-vc-tests-elc-files): Check that there are elc files and
that there is no compiled autoloads file amongst them.
(package-vc-tests-assert-delete-elc): Assert that .elc files are
present for a package.
(package-vc-tests-assert-package-alist): Assert that
`package-alist' contains a `package-desc' for package, and that
the `package-desc' has correct slot `version' and slot
`dir'.:(package-vc-tests-reset-head^): Reset head of checkout of
tested packages to HEAD^.
(package-vc-tests-packages-head): Return current checkout
revision.
(package-vc-tests-make-spec): Make a new test spec for a test
package.
(with-package-vc-tests-environment): Setup test environment.
(package-vc-tests-environment-tear-down): Tear down test
environment.
(with-package-vc-tests-installed): Withing a test environment,
install package, evaluate test body, and then tear down the test
environment.
(package-vc-tests-install-from-elpa)
(package-vc-tests-install-from-spec): Install a test package.
(package-vc-tests-checkout-from-elpa-install-from-checkout)
(package-vc-tests-checkout-with-git-install-from-checkout):
Checkout and install a test package.
(package-vc-tests-package-vc-async-wait): Wait for an
asynchronous VC command to finish.
(package-vc-tests-deftest): Define series tests for each package
in `package-vc-tests-under-test'.
(install-post-conditions): Tests that after installing a test
package the `load-history' entries, package's main file, commit,
elc files, and `package-alist' entry are correct.
(require): Test that after calling `require' the `load-history'
entries are correct.
(upgrade, upgrade-all): Test that after calling
`package-vc-upgrade'/`package-vc-upgrade-all' the `load-history'
entries, package's elc files, commit, and `package-alist' entry
are correct.
(upgrade-after-require, upgrade-all-after-require): Test that
after calling `require' followed by
`package-vc-upgrade'/`package-vc-upgrade-all' the `load-history'
entries, commit, package's elc files, and `package-alist' entry
are correct.
(rebuild): Test that after calling `package-vc-rebuild' on an
old version of a package, the package's old function, old macro,
elc files, and `package-alist' entry are correct.
(rebuild-after-require): Test that after calling `require'
followed by `package-vc-rebuild' on an old version of a package,
the package's old function, old macro, elc files, and
`package-alist' entry are correct.
(prepare-patch): Test that after calling
`package-vc-prepare-patch' the message buffer is correct.
(log-incoming): Test that after calling
`package-vc-log-incoming' the log buffer is correct.
(pkg-spec-doc-make-shell-command): Test that :doc, :make, and
:shell-command slots in a pkg spec execute.
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in:
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in:
Code template of version 0.1 of a test package.
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in:
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in:
Code template of code of version 0.2 of a test package.
* test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in:
* test/lisp/package-vc-resources/test-package-SUFFIX.texi.in:
Documentation template of a test package.
* test/lisp/package-vc-resources/Makefile.in: Makefile template of
a test package.

Co-developed-by: Philip Kaludercic <philipk@posteo.net>

(Bug#79188)
2025-12-07 22:27:13 +01:00
Jens Schmidt
8a0217ebbc
Use a consistent package description
Ensure that the long description of a package is the same regardless of
originating package archive and package installation state.

* lisp/emacs-lisp/package.el: Add documentation on additional files that
Emacs creates during package installation.
(package-desc): Update incomplete description of slot `kind'.
(package-install-from-archive): Download '*-readme.txt' from the archive
and save it as 'README-elpa' to avoid the issues described in bug#79411.
* test/lisp/emacs-lisp/package-resources/multi-file-readme.txt:
* test/lisp/emacs-lisp/package-resources/simple-single-readme.txt:
Update readmes to mark them as "server readmes" and distinguish them
from what the packages themselves provide in their documentation.
* test/lisp/emacs-lisp/package-tests.el (package-test-install-singlefile)
(package-test-describe-installed-with-ws-only-readme): Add tests.
(package-test-install-multifile): Test more files for presence.
(package-test-describe-package)
(package-test-describe-installed-multi-file-package)
(package-test-describe-non-installed-package)
(package-test-describe-non-installed-multi-file-package): Test for
server readme being used as long description. (Bug#79411)
2025-12-07 22:24:09 +01:00
Jens Schmidt
3a2a3a618e
; Fix a test-relevant typo
* test/lisp/emacs-lisp/package-tests.el (package-test-install-file): Fix
a test-relevant typo.  (Bug#79411)
2025-12-07 22:24:09 +01:00
Jens Schmidt
b71e8f6e86
Brush up macro with-package-test and related tests
* test/lisp/emacs-lisp/package-tests.el (with-package-test): Remove
unused keyword :update-news and its implementation.  Add documentation
for remaining keywords, since in particular :basedir was being overused.
Eliminate code redundancy by reimplementing keyword :upload-base in
terms of equivalent macro `ert-with-temp-directory' macro.  Implement
other minor improvements.
(package-test-install-file, package-test-bug58367, package-test-bug65475)
(package-test-install-file-EOLs, package-test-install-multifile): Remove
superfluous :basedir keyword from `with-package-test' calls to not give
future developers bad example.
(package-test-install-multifile): Move file tests out of
`with-temp-buffer', as they are independent of current buffer.  (Bug#79411)
2025-12-07 22:24:09 +01:00
Sean Whitton
459ecb3d26 ; vc-test-exec-after-3: Delete unused FAILS local value. 2025-12-07 15:04:34 +00:00
Sean Whitton
0391b3f94e Check for successful exit when parsing output with vc-exec-after
When using vc-exec-after to parse program output, check that the
program didn't die to a signal or exit with an error exit code
before attempting the parse.  Continue to use plain
vc-run-delayed where we aren't parsing output, because in these
cases it doesn't matter to CODE if the output is incomplete.

* lisp/vc/vc-dispatcher.el (vc-exec-after): <process-status>:
Treat PROC dying to a signal the same as PROC exiting non-zero.

(vc-exec-after): <accept-process-output>: Restore making a
nonblocking call, for the case of vc-exec-after called from a
process sentinel.  diff-hl *does* require this.

(vc-exec-after): <OKSTATUS>: New parameter, replacing SUCCESS,
which never worked as documented.
* test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-exec-after-3):
Test it.

(vc-run-delayed-success): New macro.
* lisp/vc/vc-git.el (vc-git-dir-status-goto-stage):
* lisp/vc/vc-hg.el (vc-hg-dir-status-files):
* lisp/vc/vc.el (vc-pull-and-push): Use it.

* lisp/obsolete/vc-arch.el (vc-exec-after):
* lisp/obsolete/vc-mtn.el (vc-exec-after):
* lisp/vc/vc-bzr.el (vc-exec-after):
* lisp/vc/vc-cvs.el (vc-exec-after):
* lisp/vc/vc-git.el (vc-exec-after):
* lisp/vc/vc-hg.el (vc-exec-after):
* lisp/vc/vc-svn.el (vc-exec-after): Update declarations.
2025-12-07 15:00:13 +00:00
Michael Albinus
b1882857ee Rework remote process support for Tramp's "smb" method
* doc/misc/tramp.texi (Remote processes): Rewrite subsection
"Running remote processes on MS Windows hosts".

* etc/NEWS: Mention remote process support for Tramp's "smb" method.
Presentational fixes and improvements.

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-smb-handle-make-process', `tramp-smb-handle-shell-command'
and `tramp-handle-start-file-process'.
(tramp-smb-matching-line): New defvar.
(tramp-smb-handle-make-process, tramp-smb-handle-shell-command)
(tramp-smb-shell-prompt): New defuns.
(tramp-smb-handle-process-file): Rewrite.
(tramp-smb-handle-start-file-process): Remove.
(tramp-smb-get-localname, tramp-smb-shell-quote-localname):
New optional argument SHARE.
(tramp-smb-send-command): Remove echoed command string.
(tramp-smb-maybe-open-connection): Initialize variables.
(tramp-smb-wait-for-output): Wait more robust.
(tramp-smb-call-winexe): Check for share.  Goto current directory.
(tramp-smb-connection-local-powershell-variables): New defconst.
Set it as connection local variables.

* test/lisp/net/tramp-tests.el (tramp-test28-process-file)
(tramp-test29-start-file-process, tramp-test30-make-process)
(tramp-test32-shell-command, tramp--test-async-shell-command)
(tramp--test-supports-processes-p): Adapt for "smb" method.
(tramp-test34-explicit-shell-file-name)
(tramp-test45-asynchronous-requests): Skip for "smb" method.
(tramp--test-check-files): Skip shell test for some special
characters in the "smb" case.
(tramp-test52-unload): Disable further tests.
2025-12-06 13:26:52 +01:00
Roi Martin
598a3604d4 Simplify fill-tests.el and add tests
Simplify fill-tests.el by grouping similar tests in the same
erts file.  Move the test code into the erts files, so it is
closer to the test cases, which provides context.  Add basic
test cases for common filling operations and for the scenarios
described in Bug#79575.

* test/lisp/textmodes/fill-tests.el (fill-test-end-period)
(fill-test-haskell): Rename from `test-fill-end-period' and
`test-fill-haskell' to follow the same naming convention of
the other tests.
(fill-test-fill-region-as-paragraph-default)
(fill-test-fill-region-as-paragraph-semlf)
(fill-test-fill-region-as-paragraph, fill-test-fill-region)
(fill-test-fill-paragraph, fill-test-fill-paragraph-semlf):
Group tests and move test code into erts files.
(fill-test-fill-paragraph-semlf-emacs-lisp-mode)
(fill-test-fill-paragraph-semlf-c-mode)
(fill-test-fill-paragraph-semlf-org-mode)
(fill-test-fill-paragraph-semlf-markdown-mode): Rename from
`fill-test-semlf-emacs-lisp-mode', `fill-test-semlf-c-mode',
`fill-test-semlf-org-mode' and
`fill-test-semlf-markdown-mode'.  Move test code into erts
files.
(fill-test-semlf, fill-test-semlf-fill-region)
(fill-test-semlf-justify)
(fill-test-semlf-sentence-end-double-space)
(fill-test-semlf-fill-column)
(fill-test-semlf-punctuation-marks, fill-test-semlf-twice)
(fill-test-semlf-fill-prefix, fill-test-semlf-indented-block)
(fill-test-semlf-revert): Delete tests since they are now
grouped with other tests.

* test/lisp/textmodes/fill-resources/fill-paragraph.erts:
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf.erts:
* test/lisp/textmodes/fill-resources/fill-region-as-paragraph.erts:
* test/lisp/textmodes/fill-resources/fill-region-as-paragraph-default.erts:
* test/lisp/textmodes/fill-resources/fill-region-as-paragraph-semlf.erts:
Add test cases for the function specified in the file name,
including tests for the scenarios described in the bug report.
* test/lisp/textmodes/fill-resources/fill-region.erts: Add
test case for custom `fill-region-as-paragraph-function',
include test code in the test specification.
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf-c-mode.erts:
* test/lisp/textmodes/fill-resources/
fill-paragraph-semlf-emacs-lisp-mode.erts:
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf-markdown-mode.erts:
* test/lisp/textmodes/fill-resources/fill-paragraph-semlf-org-mode.erts:
Rename from semlf-*-mode.erts, prefix test names with the
tested function and include test code in the test
specification.
* test/lisp/textmodes/fill-resources/semlf-fill-column.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-prefix.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-region.erts:
* test/lisp/textmodes/fill-resources/semlf-fill-region-as-paragraph.erts:
* test/lisp/textmodes/fill-resources/semlf-indented-block.erts:
* test/lisp/textmodes/fill-resources/semlf-justify.erts:
* test/lisp/textmodes/fill-resources/semlf-punctuation-marks.erts:
* test/lisp/textmodes/fill-resources/semlf-revert.erts:
* test/lisp/textmodes/fill-resources/semlf-sentence-end-double-space.erts:
* test/lisp/textmodes/fill-resources/semlf-twice.erts:
* test/lisp/textmodes/fill-resources/semlf.erts: Delete
files.  (Bug#79575)
2025-12-06 14:04:32 +02:00
Mattias Engdegård
5e7a71d0f4 Don't emit print-circle refs for empty string and vector
The empty vector and string(s) are immutable, contain no references and
always read as the same objects.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Turn macro into...
(print_circle_candidate_p): ...a function, and exclude [] and "".
* test/src/print-tests.el (print-circle): Add test case.
2025-12-04 17:52:14 +01:00
Stephen Gildea
7f04e046fb ; time-stamp: factor out two small, internal utilities
* lisp/time-stamp.el (time-stamp--message, time-stamp--system-name):
New utility functions.
(time-stamp, time-stamp-once, time-stamp-string-preprocess):
Call the new functions.
2025-12-03 23:44:45 -08:00
Stephen Gildea
77a57041d0 time-stamp: Add test of multi-line start regexp
* test/lisp/time-stamp-tests.el: (time-stamp-custom-start-multiline):
New test, inspired by Amin Bandali.
2025-11-30 12:36:12 -08:00
Mattias Engdegård
ef903e0f5a * test/src/data-tests.el (data-tests-ash-lsh): Test for bug#79876. 2025-11-29 19:41:16 +01:00
Stephen Gildea
9f2b1c43c9 time-stamp: return quicker when inactive
* 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.
2025-11-29 09:14:58 -08:00
Sean Whitton
1677c4681a Handle copying additions & removals between working trees
* 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.
2025-11-29 14:35:39 +00:00
Michael Albinus
6346f5b053 Sync with Tramp 2.8.0.5
* doc/misc/tramp.texi (Remote processes): Improve description
where direct asyn processes won't work.

* lisp/net/tramp-cache.el (with-tramp-saved-connection-properties):
Adapt `tramp-verbose' less aggressive.

* lisp/net/tramp-container.el (tramp-kubernetes--context-namespace):
Use `string-join'.

* lisp/net/tramp-message.el (tramp-get-debug-file-name):
Modify debug file name.
(tramp-debug-message): Simplify.

* lisp/net/tramp-sh.el (tramp-actions-before-shell)
(tramp-actions-copy-out-of-band):
Add `tramp-keyboard-interactive-authentication-prompt-regexp'.

* lisp/net/tramp.el (tramp-encoding-shell): Fix docstring.
(tramp-keyboard-interactive-authentication-prompt-regexp): New defcustom.
(tramp-action-ignore-message): New defun.

* test/lisp/net/tramp-tests.el (tramp-test10-write-region)
(tramp-test10-write-region-file-precious-flag)
(tramp-test10-write-region-other-file-name-handler)
(tramp-test27-load, tramp-test32-shell-command)
(tramp-test32-shell-command-dont-erase-buffer)
(tramp-test34-connection-local-variables)
(tramp-test36-vc-registered, tramp-test39-make-lock-file-name)
(tramp-test39-detect-external-change)
(tramp-test45-asynchronous-requests): Adapt tests.
2025-11-28 17:38:36 +01:00
Neal Sidhwaney
26bd33c853 Add test cases for 'dolist'
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)
2025-11-27 11:02:10 +02:00
Stefan Monnier
e10c4982dc Fix completion error in C-x RET f ut-8-d TAB
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.
2025-11-26 09:53:19 -05:00
Aaron Jensen
16a7051888 Fix indentation of keyword argument arrays/hashes in ruby-mode
* 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)
2025-11-26 01:31:12 +02:00
Stephen Gildea
36f1fde9b9 * test/lisp/time-stamp-tests.el: More tests of word conversions. 2025-11-25 14:15:59 -08:00
Juri Linkov
33d813c63b Fix query-replace-regexp for using '^' with calculated replacement '\,'
* 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.
2025-11-24 20:14:15 +02:00
Stephen Gildea
1f2a161f93 ; * lisp/time-stamp.el: Reformat some doc strings. 2025-11-23 18:32:41 -08:00
Reuben Thomas
e1f851e840 Fix ispell’s handling of comment-end when adding local words
* 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
2025-11-22 13:15:45 +02:00
Sean Whitton
896449d65a ; * test/lisp/vc/vc-tests/vc-test-misc.el: Fix compiler warnings. 2025-11-20 20:39:37 +00:00
Elías Gabriel Pérez
bfa0cb81dd hideshow: Fix regressions. (Bug#79857)
* lisp/progmodes/hideshow.el (hs-block-positions): Exit the
function if 'hs-forward-sexp' fails.
(hs-hide-level-recursive): Fix infloop.
* test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1):
(hideshow-hide-level-2): Update tests.
2025-11-19 09:20:00 +02:00
Eli Zaretskii
858d54d51d ; Fix cleanup in buffer-tests
* 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.
2025-11-16 11:08:11 +02:00
João Távora
7a3b8c6df5 Eglot: add two semtok 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.
2025-11-13 22:18:46 +00:00
Sean Whitton
4358838a3b vc-do-command: Support discarding standard error
* 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.
2025-11-10 18:08:39 +00:00
João Távora
1772a4e468 ; Eglot: unbreak "lsp-abiding-column" test for newer clangd
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.
2025-11-10 12:28:14 +00:00
Steven Allen
5d11ee9f54 Lookup cached basic-auth credentials with the correct key
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.
2025-11-08 19:21:10 +02:00
Eli Zaretskii
64fea996f3 Adapt vc-test-misc to MS-Windows
* 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.
2025-11-08 14:02:44 +02:00
Sean Whitton
7557dcbabf New tests for vc-exec-after
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test--exec-after-wait): New macro.
(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): New tests.
2025-11-07 15:40:25 +00:00
Mattias Engdegård
0c694624c3 * test/src/comp-tests.el (setcarcdr): Don't mutate literals. 2025-11-06 16:22:13 +01:00
Juri Linkov
2f6e5d2eda * test/lisp/emacs-lisp/map-ynp-tests.el: Use 'eval-expression-debug-on-error'.
(test-map-ynp-kmacro): Bind 'eval-expression-debug-on-error' to nil
instead of silencing 'backtrace-print'.
2025-11-05 09:15:05 +02:00
Juri Linkov
2bec93b5f4 * test/lisp/emacs-lisp/map-ynp-tests.el: Silence backtrace.
(test-map-ynp-kmacro): Ignore 'backtrace-print' that prints
unrequested backtrace (bug#67836).
2025-11-04 19:23:55 +02:00
Mattias Engdegård
d123ac1400 Don't assume that literal constants are eq-unique in tests
* 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).
2025-11-03 10:14:55 +01:00
F. Jason Park
f591d1c027 ; Skip erc-keep-place-indicator test on Emacs 27
* 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".
2025-11-02 20:25:27 -08:00
Yuan Fu
b01435306a
Change tree-sitter query predicate names (bug#79687)
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.
2025-11-02 17:11:55 -08:00
Spencer Baugh
fbb7eb5686 * test/lisp/emacs-lisp/map-ynp-tests.el: New file (bug#67836). 2025-11-01 20:40:20 +02:00
Juri Linkov
2447188a69 'map-y-or-n-p' now uses the minibuffer to read a char (bug#79664)
* 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.
2025-11-01 20:27:45 +02:00
Juri Linkov
ab4a616b0b 'read-multiple-choice' now uses the minibuffer to read a char (bug#79664)
* 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'.
2025-11-01 20:21:09 +02:00
David Ponce
13ec843352 cl-extra.el: Use the new API to speed up dispatch on derived types
* 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.
2025-10-31 13:49:14 -04:00
Spencer Baugh
97d2a659e8 Optimize PCM regex to not contain adjacent wildcards
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.
2025-10-30 19:24:51 +02:00
Eshel Yaron
330aa07f00
; elisp-scope.el: Improve face specification handling.
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.
2025-10-29 17:20:03 +01:00