1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-31 01:32:00 -07:00
Commit graph

8685 commits

Author SHA1 Message Date
Jim Porter
e9847f8263 Handle Lisp errors in Eshell workers
* lisp/eshell/esh-worker.el (eshell-worker-name): New generic function.
(eshell-worker--error): New defsubst.
(eshell-output-object-to-target, eshell-close-target): Wrap
'cl-call-next-method' in error handlers.

* test/lisp/eshell/esh-worker-tests.el
(esh-worker-test/pipe/error-handling)
(esh-worker-test/map-lines/error-handling)
(esh-worker-test/apply-lines/error-handling): New tests.
2026-05-27 18:35:14 -07:00
Jim Porter
a1cbfe27b1 Add 'apply-lines' and 'map-lines' Eshell commands
* lisp/eshell/esh-worker.el (eshell-map-lines-worker)
(eshell-apply-lines-worker): New structs.
(eshell-map-lines-worker--apply): New generic function.
(eshell-output-object-to-target, eshell-close-target): New methods.
(eshell/map-lines, eshell/apply-lines): New functions.

* test/lisp/eshell/esh-worker-tests.el (eshell-test-line-number): New
defvar...
(eshell-test-number): ... use it in this new function.
(esh-worker-test/map-lines/eshell-one-line)
(esh-worker-test/map-lines/eshell-multiple-lines)
(esh-worker-test/map-lines/eshell-multiple-batches)
(esh-worker-test/map-lines/external-one-line)
(esh-worker-test/map-lines/external-multiple-lines)
(esh-worker-test/map-lines/numbers)
(esh-worker-test/map-lines/numeric-conversion)
(esh-worker-test/apply-lines/eshell-one-line)
(esh-worker-test/apply-lines/eshell-multiple-lines)
(esh-worker-test/apply-lines/external-one-line)
(esh-worker-test/apply-lines/external-multiple-lines)
(esh-worker-test/apply-lines/numbers)
(esh-worker-test/apply-lines/numeric-conversion): New tests.
2026-05-25 17:20:19 -07:00
Jim Porter
751dccb17e Add basic support in Eshell for piping to Lisp commands
* lisp/eshell/esh-worker.el:
* test/lisp/eshell/esh-worker-tests.el: New files.

* lisp/eshell/esh-cmd.el (eshell-lisp-command): Call 'eshell-get-pipe'
when the command is a pipe target.

* lisp/eshell/em-basic.el (eshell/echo): Mark as producing literal
results.
2026-05-25 17:20:19 -07:00
Jim Porter
47cda4ecac Allow writing a lambda function as a command in Eshell
* lisp/eshell/esh-cmd.el (eshell-lisp-command): Don't try to call a
literal lambda.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/literal-lambda): New
test.
2026-05-24 17:30:19 -07:00
Pip Cet
b72dcebdab Avoid crash in self-insert-command with non-ASCII auto-fill
* src/cmds.c (internal_self_insert): If the autofill function changed
the newline character we inserted, don't attempt to restore point.
* test/src/cmds-tests.el (self-insert-nonascii-autofill): New.
2026-05-24 12:32:28 +00:00
Pip Cet
7f8ac8bf6f Avoid crash in self-insert-command for peculiar arguments
* src/cmds.c (internal_self_insert): Don't call auto-fill-function
after inserting zero newlines.
* test/src/cmds-tests.el (self-insert-zero-newlines): New.
2026-05-24 11:51:38 +00:00
Pip Cet
94dbab2fe4 Fix 'do_casify_natnum' for events with all flags set
* src/casefiddle.c (do_casify_natnum): Extend range a little, to cover
character events with all modifier flags set.
* test/src/casefiddle-tests.el (casefiddle-allflags): New test.
2026-05-24 10:11:33 +00:00
Pip Cet
c146e3643c Fix off-by-one error in 'styled_format'
This would (rarely) result in composition properties being shared
across the concatenation of two copies of a string.

* src/editfns.c (styled_format): Include the first argument in the
range.
* test/src/editfns-tests.el (editfns-tests--format-composition-property):
New.
2026-05-24 09:23:05 +00:00
Sean Whitton
a96fc7d546 Merge from origin/emacs-31
4f13f52a3a * build-aux/git-hooks/commit-msg: Replace Markdown-style ...
dd42133315 vc-test--rename-file: Disable part of test for SCCS
eb653865c3 markdown-ts-mode: Don't enable unconditionally by default

# Conflicts:
#	etc/NEWS
2026-05-23 17:30:21 +01:00
Sean Whitton
dd42133315 vc-test--rename-file: Disable part of test for SCCS
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file):
Disable part of test for SCCS.
2026-05-23 16:53:36 +01:00
Eli Zaretskii
ccc94458fb Merge from origin/emacs-31
7a17f97baa Prettify special glyphs
f13287fde0 Revert "sh-script: Mark + and * as punctuation rather tha...
70b79b3ed8 Rename `icalendar-recur' type and related functions
3d2bb233f2 ; Minor Tramp changes
f6281d757d ; * etc/NEWS: Tell how to disable 'markdown-ts-mode'.
142b1e0d4c Fix Lisp injection via X-Draft-From in Gnus
d6f7b2d99b Save/restore old_buffer slot via window configurations (B...
e0fbecaf65 Adapt ert-remote-temporary-file-directory settings
3de7f0ce5e Fix warning message in 'markdown-ts-mode--initialize'
7df8604ea6 ; Improve documentation of lazy-highlight in search and r...
2936b36164 Fix "assertion 'GTK_IS_WINDOW (window)' failed"
98348a0bdc [Xt] Fix child frame resizing glitch
13b29eebc1 Eglot: use standard face for completion annotations (bug#...

# Conflicts:
#	etc/NEWS
2026-05-23 07:23:33 -04:00
Richard Lawrence
70b79b3ed8 Rename `icalendar-recur' type and related functions
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.
2026-05-23 13:25:19 +03:00
Michael Albinus
3d2bb233f2 ; Minor Tramp changes
* doc/misc/tramp.texi (Frequently Asked Questions):
google-drive has been disabled in GNOME 50.

* lisp/net/tramp-cmds.el (tramp-enable-method): Upcase prompt.

* lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
(tramp-sh-handle-process-file): Improve setting of environment variables.

* test/lisp/net/tramp-tests.el (tramp-methods) <mock>:
Add `tramp-tmpdir'.  Adapt `tramp-login-program'.
(ert-remote-temporary-file-directory): Improve expansion.
(tramp-test35-remote-path): Adapt test.
2026-05-23 10:25:46 +02:00
João Távora
e86825e595 Merge from origin/emacs-31
655302cc21 Fix 'shr-outline-search' (bug#81073)
1754015c60 Improve auth-source-backend-parse
8f31ccbf82 Eglot: announce markdown support for completion docs
aad170d1ed markdown-ts-mode: hide fence lines in view-mode (bug#81081)
133d1d591c markdown-ts-mode: align default face definitions with mar...
e0aeee2dc5 Fix markdown-ts-mode atx_heading face computation (bug#81...
997fc2cef7 Allow markdown-ts--run-command-in-code-block to ignore ou...
7d84e69a34 hideshow: Menu entry for 'hs-toggle-all'
e90cafc288 ; * doc/lispref/display.texi (Displaying Faces): Mention ...
520c5b7c71 ; * doc/lispref/text.texi (Special Properties): Fix last ...
8095fbef77 doc/lispref/text.texi: Add complement to commit f4a1c00656
9436d92c5d Eglot: fix eglot--format-makrup when MARKUP just a string
9ba65aa965 Fix missing margin face on display prop in erc-stamp
2026-05-21 00:24:52 +01:00
Pip Cet
0b5ead9923 Detect some API violations in combine-change-calls (bug#80877)
Quickly verify that the number of unchanged characters before and
after the region that changes are supposed to be limited to doesn't
change.

Suggested by Stefan Monnier.

* lisp/subr.el (combine-change-calls-1): Copy BEG into a marker, and
count the characters after the changed region.  After the changes,
ensure the character counts still match.
* test/lisp/subr-tests.el (subr-test-combine-change-calls-error): New.
2026-05-20 11:27:40 +00:00
F. Jason Park
9ba65aa965 Fix missing margin face on display prop in erc-stamp
* 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.
2026-05-18 15:07:34 -07:00
Sean Whitton
641754e870 Merge from origin/emacs-31
28a13b01c7 vc-refresh-state: Override default-directory for backend ...
389874c533 Eglot: unbreak for treesit-less builds
10e91e096d Get selected item in newsticker list view
6bd73af241 ; * test/lisp/jsonrpc-tests.el: Adjust timeouts for CI EM...
eb90c528f3 ; * lisp/progmodes/eglot.el (eglot-code-action-indication...
1d7d6ffedb ; * etc/PROBLEMS: Fix entries about display of Emoji on T...
6c1829bf4c Eglot: fix thinko in recent markdown-related commit (bug#...
36036e71c0 Jsonrpc: migrate more tests to Python subprocess fixtures
0977d5915d Eglot: add left-fringe code action indicator (bug#80326)
b7825c3a27 Fix auth-source-backends-parse
d89054627c Fix updates of embedded formulas by 'calc-embedded-update...
1832a93547 ; * src/fns.c (Fequal): Doc fix.
f68e7a0a41 ; Improve documentation of commands that move by compilat...
2026-05-18 22:16:46 +01:00
João Távora
6bd73af241 ; * test/lisp/jsonrpc-tests.el: Adjust timeouts for CI EMBA testing 2026-05-18 17:22:30 +01:00
Jim Porter
d4cb550dba ; Improve last change
* test/src/process-tests.el (process-tests/broken-pipe): Use
CONNECTION-TYPE.
(process-tests/broken-pipe/pipe-all)
(process-tests/broken-pipe/pipe-stdin): Skip via 'skip-when'.
(process-tests/broken-pipe/pty)
(process-tests/broken-pipe/pty-stdin): Remove these invalid tests; EPIPE
from a PTY doesn't make sense.
2026-05-18 08:37:42 -07:00
Jim Porter
e381cf1fc9 Allow child processes to continue after EPIPE
This ensures that if the child process closed its stdin and Emacs tries
to write to it, the process can still do any remaining work and exit
normally.  In practice, this can occur with commands like "head(1)"
(bug#79079).

* src/fileio.c (file_for_stream): New function, extracted from...
(Fset_binary_mode): ... here.
(Ffile__close_stream): New function.

* src/process.c (send_process): When encountering EPIPE, only close the
fd for the pipe to the child process's stdin.

* lisp/eshell/esh-io.el (eshell-output-object-to-target): Don't check
for process liveness anymore.

* test/src/process-tests.el (process-tests/broken-pipe): New function.
(process-tests/broken-pipe/pipe, process-tests/broken-pipe/pty)
(process-tests/broken-pipe/pipe-stdin)
(process-tests/broken-pipe/pty-stdin): New tests.

* etc/NEWS: Announce this change.
2026-05-17 17:24:10 -07:00
Jim Porter
a557bf69b4 Ensure that process-tests clean up test processes
* test/src/process-tests.el (start-process-should-not-modify-arguments):
Clean up test process.
(process-test--check-pipe-process): New macro...
(process-test-make-pipe-process-no-buffer): ... call it.
2026-05-17 17:24:10 -07:00
João Távora
36036e71c0 Jsonrpc: migrate more tests to Python subprocess fixtures
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.
2026-05-17 19:28:07 +01:00
Eli Zaretskii
407b5ce7ab Merge from origin/emacs-31
cf96e9cb5a ; Fix byte-compilation warnings in non-Tree-Sitter builds
23575adc7b ; * doc/lispref/variables.texi (Local Variables): Fix typ...
8b6fb2f646 ; * doc/lispref/variables.texi (Local Variables): Fix 'na...
d3c72b8389 ; * src/xdisp.c (display_line): Fix commentary (bug#80693).
a981517b72 Fill margins with 'margin' face on truncated screen lines
8e37499035 ; * doc/lispref/os.texi (Init File): Fix markup (bug#81049).
f4c326c378 ; * src/sfnt.c (sfnt_read_cmap_format_12): Assert there's...
bf89ee6d07 ; * etc/PROBLEMS: Cursor not shown on Windows with system...
20500d6200 ; htmlfontify: Handle 'reset' face attribute value (bug#8...
d0d657fa90 ; Minor Tramp cleanup
93ea0d7d28 ; Improve documentation of VC commands in Dired
318084829c Eglot: adjust reference to completion frontends in manual
2a166c2dbd Eldoc: display documentation in visual-line-mode
aba60ad0c5 Eglot: prefer markdown-ts-view-mode for markup rendering ...
689c3bd508 Use 'read-multiple-choice' in 'markdown-ts-mode' (bug#81027)
71809ee5df Fix 'markdown-ts-code-span' face (bug#81026)
286833e401 Add read-only 'markdown-ts-view-mode' (bug#81023)
b39c123490 Fix strikethrough in 'markdown-ts-mode' (bug#80991)
0be998d4bc Fix code-span in headings in 'markdown-ts-mode' (bug#80979)
a00beb3a31 Make 'markdown-ts-inline-images' buffer local and test fo...
a0c05029fd * etc/NEWS: Mention new user option tramp-propagate-emacs...
2e71d2c709 Propagate EMACSCLIENT_TRAMP to remote hosts with Tramp
ff96db93f2 keyboard-tests.el: Try and fix the failure on EMBA
ce3098752c doc: Remove long obsolete references to `package-initialize`
9bc04b001a vc-next-action: Call vc-delete-file on FILESET-ONLY-FILES
13039e3442 ; touch-up last commit: copyright and comments
c2a24dcec8 ; update msys2 build helper for Emacs 31 & UCRT
3630baae72 hideshow: Support new 'margin' face for margin indicators...
20d17df3f4 Use the new 'margin' face in Flymake (bug#80693)
07f2bbc905 vc-dir-resynch-file: Pass down non-truename'd FILE
2026-05-16 07:24:17 -04:00
Eli Zaretskii
87e4687749 Merge from origin/emacs-31
7eab6ef3ce Fix 'sgml-parse-tag-backward' to handle tags in comments
09dc864b0b Fix eww-submit for forms with no action (bug#80918)
0e7a24d931 * lisp/progmodes/hideshow.el (hs--set-variable): Use 'set...
f12b01582d Fix Completions buffer disappearing with tmm-menubar (bug...
519fd83211 Fix secrets.el when Emacs is a flatpak
9e4ea934f2 Fix 'prepare-user-lisp' to follow symlinks
e613e38021 Update "timeout" to 2.1.6
196fd80689 [GTK3, HiDPI] Fix width/height round-trip through Configu...
acc07f1a03 [GTK3] On Expose, repaint the border before the content
5323eebcff Test read-passwd behavior (bug#80838)
01c5990dd0 Fix nested read-passwd calls (bug#80838)
027043df25 ; * lisp/gnus/message.el (message-server-alist): Doc fix ...
3b608b233e Fix terminal emulation of "ESC [ K" sequence
6a605c65a8 Fix vertical-motion across overlay strings with embedded ...
e4d529c67b ; Fix last change
d54faa0f1b Mark gnus-dbus.el as obsolete
9bf2a19bb2 Move gnus-dbus.el to obsolete/gnus-dbus.el
984024daf3 Gnus: Use new sleep library
d7c130972e ; * lisp/term/pgtk-win.el (icon-map-list): Fix :type.
5579893ed7 ; Don't block/unblock input in text_extents methods
547b1ee7b6 Fix Rmail behavior wrt globalized minor modes
6ba05106f4 Fix display images in the display margins
56f27dd9f0 Eglot: fix eglot--sig-info with non-UTF-32 positionEncoding
543d8a7a9d [NS] Fix deprecated variable (bug#80985)

# Conflicts:
#	etc/NEWS
2026-05-16 07:17:51 -04:00
Michael Albinus
d0d657fa90 ; Minor Tramp cleanup
* 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.
2026-05-14 12:31:04 +02:00
Michael Albinus
2e71d2c709 Propagate EMACSCLIENT_TRAMP to remote hosts with Tramp
* doc/misc/tramp.texi (Remote processes):
Explain `tramp-propagate-emacsclient-tramp'.

* lisp/net/tramp.el (tramp-remote-process-environment): Adapt docstring.
(tramp-propagate-emacsclient-tramp): New defcustom.
(tramp-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
(tramp-sh-handle-process-file): Use it.

* test/lisp/net/tramp-tests.el (tramp-test33-environment-variables):
Adapt test.
2026-05-13 18:39:04 +02:00
Stefan Monnier
ff96db93f2 keyboard-tests.el: Try and fix the failure on EMBA
* test/src/keyboard-tests.el (keyboard-sigint-to-quit): Fix a small
race condition and avoid `sit-for` returning early.
2026-05-13 11:10:15 -04:00
F. Jason Park
1613f2e652 Preserve order of local ERC modules for activation
* etc/ERC-NEWS: Add new section for ERC 5.7.
* lisp/erc/erc.el (erc--update-modules): Reverse returned list.
* test/lisp/erc/erc-tests.el (erc--update-modules/local): Update.
2026-05-12 21:03:02 -07:00
F. Jason Park
76f5181bc6 Improve source NUH handling in ERC
* lisp/erc/erc.el (erc--user-nuh-message-types): New variable.
(erc--shuffle-nuh-nickward, erc--interpret-nuh): Replace former with
latter, whose behavior is easier to predict.
* test/lisp/erc/erc-tests.el (erc--interpret-nuh): New test.
2026-05-12 21:03:02 -07:00
F. Jason Park
f3da59a8c5 Improve isolation of some ERC test environments
* lisp/erc/erc.el (erc--lwarn): During tests where the variable
`erc--warnings-buffer-name' is non-nil, don't display the Warnings
buffer, and inhibit messages for the benefit of batch runs.
* test/lisp/erc/erc-tests.el (erc--modify-local-map): Protect various
hooks from module-setup code.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-equal-with-props): Act more like
`equal-including-properties' in accepting arbitrary objects rather than
just strings.
(erc-tests-common-with-global-modules): New macro.
(erc-tests-common-frozen-options): New variable.
(erc-tests-common-with-frozen-options): New macro.
(erc-tests-common-make-server-buf): Accept a buffer for the NAME arg.
(erc-tests-common-assert-get-inserted-msg-readonly-with): Instead of
shadowing, use macro to protect calling environment from effects of
activating global module.
2026-05-12 21:03:02 -07:00
F. Jason Park
88e8b8c073 ; Remove some forward declarations from ERC tests
* lisp/erc/erc.el (erc--insert-before-markers-transplanting-hidden):
Don't deliberately return anything because the return value is
undefined.  The only existing call site, in `erc-insert-line', invokes
the function indirectly via `erc--insert-line-function' and discards the
result.
* test/lisp/erc/erc-scenarios-join-display-context.el: Require
`erc-join'.
* test/lisp/erc/erc-scenarios-log.el: Remove forward declarations and
require `erc-stamp'.
* test/lisp/erc/erc-scenarios-match.el: Require `erc-match'.
* test/lisp/erc/erc-scenarios-misc.el
(erc-scenarios-base-kill-server-track): Suppress unwanted newline in
test output.
* test/lisp/erc/erc-scenarios-sasl.el (erc-scenarios-sasl--plain-fail):
Don't redundantly bind `erc--warnings-buffer-name' or create a buffer
for it.  Use literal value assigned by test fixture instead.
* test/lisp/erc/erc-scenarios-services-misc.el: Require `erc-services'.
* test/lisp/erc/erc-tests.el (erc-handle-irc-url): Remove redundant
`save-excursion'.
(erc-tests--modules): Reflow into single column for easier management of
divergent WIP patch sets.  This should help minimize manual surgery when
applying them atop one another.
* test/lisp/erc/resources/erc-scenarios-common.el: Remove unused
`require's and forward declarations from top of file.
(erc-scenarios-common--make-bindings): Remove the non-existent
`erc-auth-source-parameters-join-function' and add
`erc--warnings-buffer-name'.  The latter's buffer, if created, will be
killed automatically when the test body exits.
(erc-scenarios-common-with-cleanup): Generate locally scoped defvars to
be used in a manner similar to `dlet' for user options yet to be loaded.
(erc-scenarios-common--assert-date-stamps): Don't run when `erc-stamp'
isn't loaded.
2026-05-12 20:27:39 -07:00
Michael Albinus
c68f3237be Fix file-name-non-special implementation of get-file-buffer
* lisp/files.el (file-name-non-special): Fix `get-file-buffer'.
(Bug#80718)

* test/lisp/files-tests.el
(files-tests-file-name-non-special--temp-file-prefixes): Extend list.
(w32-downcase-file-names): Declare.
(files-tests-file-name-non-special-get-file-buffer): Adapt test.
2026-05-12 08:48:43 +02:00
Pip Cet
5323eebcff Test read-passwd behavior (bug#80838)
* test/lisp/auth-source-tests.el (auth-source-test--displayed-string):
(auth-source-test-read-passwd):
(auth-source-test-read-passwd-revealed):
(auth-source-test-read-passwd-nested): New.
2026-05-10 20:00:41 +00:00
Sean Whitton
fdab8a9185 ; Revert Eric's commits from February.
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.
2026-05-07 15:29:53 +01:00
Michael Albinus
eae96d9fcb Handle long environment variables in Tramp oricesses
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Handle loooong environment variables.  (Bug#80783)

* test/lisp/net/tramp-tests.el (tramp-test33-environment-variables):
Adapt test.
2026-05-06 16:06:50 +02:00
Stefan Monnier
a952324e9b keyboard.c: Allow SIGINT to quit in batch mode, instead of exit
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.
2026-05-04 12:49:35 -04:00
Michael Albinus
9c0a699c59 Adaot tramp-tests.el
* test/lisp/net/tramp-tests.el (ert-remote-temporary-file-directory):
Ensure that it is expanded.
2026-05-04 16:09:10 +02:00
João Távora
e24d9232e0 Jsonrpc: add new tests using Python subprocesses
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.
2026-05-04 13:32:37 +01:00
Chris Roberts
b376c405aa ; Add a test for sqlite-close
* test/src/sqlite-tests.el (sqlite-closed-db): Add test.
(Bug#80908)

Copyright-paperwork-exempt: yes
2026-05-02 14:20:42 +03:00
F. Jason Park
cf9728c4be Only perform erc-log-insert-log-on-open setup once
* 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)
2026-04-30 15:46:42 -07:00
F. Jason Park
ba2a150740 Restore erc-last-saved-position from previous session
* 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.
2026-04-30 15:46:38 -07:00
F. Jason Park
40b6f0180b ; Tweak some ERC tests and related utilities
* 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.
2026-04-30 15:46:29 -07:00
Paul Eggert
4fcc8a473a ; Spelling fixes. 2026-04-29 22:45:51 -07:00
Vladimir Kazanov
27a18cfd7e Add ERT coverage for read_key_sequence behaviour
* test/src/keyboard-tests.el
(keyboard-tests--rks-fake-posn)
(keyboard-tests--rks-observe)
(keyboard-tests--rks-execute)
(keyboard-tests--rks-with-function-key-bindings)
(keyboard-tests--rks-with-event-kinds)
(keyboard-tests--rks-call-with-live-window-maps): Test helpers.
(keyboard-tests-rks-prefix-then-key)
(keyboard-tests-rks-unbound-returns-sequence)
(keyboard-tests-rks-bound-sequence-ends-read)
(keyboard-tests-rks-decode-fires-without-binding)
(keyboard-tests-rks-input-decode-map)
(keyboard-tests-rks-function-key-map)
(keyboard-tests-rks-function-key-map-on-undefined)
(keyboard-tests-rks-key-translation-before-function-key)
(keyboard-tests-rks-function-key-skipped-when-bound)
(keyboard-tests-rks-input-decode-after-function-key)
(keyboard-tests-rks-key-translation-overrides-bound-sequence)
(keyboard-tests-rks-upcase-fallback)
(keyboard-tests-rks-no-upcase-fallback)
(keyboard-tests-rks-dont-downcase-last)
(keyboard-tests-rks-shifted-function-key-fallback)
(keyboard-tests-rks-switch-frame-delayed)
(keyboard-tests-rks-unbound-down-mouse-dropped)
(keyboard-tests-rks-mode-line-fake-prefix)
(keyboard-tests-rks-mode-line-fake-prefix-continued)
(keyboard-tests-rks-clicked-buffer-switch)
(keyboard-tests-rks-help-char): Tests covering for read_key_sequence.
2026-04-29 23:31:29 -04:00
Eli Zaretskii
7017fcc4c5 ; Add new test to files-tests
* test/lisp/files-tests.el
(files-tests-directory-files-recursively-w32): New test.
2026-04-29 18:04:48 +03:00
Eli Zaretskii
08a22b8965 ; Don't skip 'vc-test-src-version-diff' test
* test/lisp/vc/vc-tests/vc-tests.el (vc-test-src-version-diff):
Don't skip, it passes.
2026-04-27 15:47:57 +03:00
Eli Zaretskii
8d4c47c880 Fix vc-tests for SRC
* 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)
2026-04-27 15:41:27 +03:00
Philip Kaludercic
e83052c095
Add lexical-binding cookies to multi-file-0.2.3.tar
* test/lisp/emacs-lisp/package-resources/multi-file-0.2.3.tar:
Update multi-file.el and multi-file-sub.el files.
2026-04-27 11:48:58 +02:00
Yuan Fu
9e70acea67
Fix tree-sitter embedded parser range
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.
2026-04-27 02:14:49 -07:00
Stefan Monnier
4bd5608513 (register--get-method-type): Fix one more case (bug#80894)
* 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.
2026-04-26 12:18:44 -04:00