summaryrefslogtreecommitdiff
path: root/test/lisp/erc
AgeCommit message (Collapse)Author
2026-05-21Merge from origin/emacs-31João Távora
655302cc212 Fix 'shr-outline-search' (bug#81073) 1754015c603 Improve auth-source-backend-parse 8f31ccbf823 Eglot: announce markdown support for completion docs aad170d1edf markdown-ts-mode: hide fence lines in view-mode (bug#81081) 133d1d591cb markdown-ts-mode: align default face definitions with mar... e0aeee2dc5f Fix markdown-ts-mode atx_heading face computation (bug#81... 997fc2cef77 Allow markdown-ts--run-command-in-code-block to ignore ou... 7d84e69a349 hideshow: Menu entry for 'hs-toggle-all' e90cafc2886 ; * doc/lispref/display.texi (Displaying Faces): Mention ... 520c5b7c71b ; * doc/lispref/text.texi (Special Properties): Fix last ... 8095fbef772 doc/lispref/text.texi: Add complement to commit f4a1c006569f 9436d92c5da Eglot: fix eglot--format-makrup when MARKUP just a string 9ba65aa9656 Fix missing margin face on display prop in erc-stamp
2026-05-18Fix missing margin face on display prop in erc-stampF. Jason Park
* 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-12Preserve order of local ERC modules for activationF. Jason Park
* 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-12Improve source NUH handling in ERCF. Jason Park
* 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-12Improve isolation of some ERC test environmentsF. Jason Park
* 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; Remove some forward declarations from ERC testsF. Jason Park
* 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-04-30Only perform erc-log-insert-log-on-open setup onceF. Jason Park
* 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-30Restore erc-last-saved-position from previous sessionF. Jason Park
* 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; Tweak some ERC tests and related utilitiesF. Jason Park
* 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-16ert-play-keys functionVincent Belaïche
* lisp/emacs-lisp/ert-x.el (ert-play-keys): new defun. * test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo) (undo-test-point-after-forward-kill): Use new function `ert-play-keys' and `(ert-with-test-buffer (:selected t) ...)' rather (with-temp-buffer (switch-to-buffer (current-buffer) ...)'. * test/lisp/erc/erc-scenarios-spelling.el (erc-scenarios-spelling--auto-correct): Use new function `ert-play-keys' and `(ert-with-buffer-selected ...)' rather than `execute-kbd-macro' and `(with-current-buffer ... (set-window-buffer nil (current-buffer) ...)'. * doc/misc/ert.texi (Helper Functions): Document ert-play-keys, and differences between ert-simulate-command, ert-simulate-keys & ert-play-keys. * test/lisp/emacs-lisp/ert-x-tests.el (ert-x-tests-play-keys) (ert-x-tests-simulate-command, ert-x-tests-simulate-keys): New tests.
2026-03-23Add tests for erc-track-faces-normal-list regressionF. Jason Park
* test/lisp/erc/erc-track-tests.el (erc-track-tests--modified-channels/baseline): Update assertion to expect an unchanged mode line segment if `erc-track-faces-normal-list' lacks a ranked face in the latest inserted message. (erc-track-modified-channels/baseline/nonotice) (erc-track-modified-channels/priority-only-all/baseline/nonotice): New tests. (Bug#80659)
2026-03-04Revert "Repair serious breakage in the batch tests."Michael Albinus
This reverts commit feac53141577161c32a7a6dfe75399a5ae98a7c1. This patch has deactivated 253 test cases without a sufficient reasoning. Instead it speaks about a shotgun in its commite message. The patch is reverted because - It hasn't been discussed on emacs-devel. It should have, because it is a serious change in our infrastructure (new official tag :nobatch). Any documentation of this change, for example in test/README, is missing. - The proper way to deactivate such tests would have been (skip-when noninteractive) Even better to skip for the respective reasons. - There is no fault report. There is no information about how these tests have failed. Since it hasn't been a problem so far for us, nobody will work on a fix forever.
2026-02-25Repair serious breakage in the batch tests.Eric S. Raymond
There were a bunch of tests that were breaking make check and should never be run in batch mode, because they do things like assuming there is a controlling tty or assuming we can access network services when we can't (e/g. in a CI/CD environment). I have shotgunned this problem by tagging all the failing tests with :nobatch and then changing the default and expensive selectors so make check won't barf all over its shoes. As many of these :nobatch should be individually removed as possible, after upgrading the test harness to mock the environmental stuff they need. Investigate these failures with "make check-nobatch".
2026-01-11; Don't use cl-letf with generic function in ERC testF. Jason Park
* test/lisp/erc/erc-tests.el (erc--update-channel-modes): Use advice instead. See 058bac45 "cl-generic.el: Avoid an O(N^2) behavior". (Bug#80175) * test/lisp/erc/resources/erc-d/erc-d-tests.el (erc-d-tests--start-server): Increase timeout to hopefully address anomalous EMBA failure. Unrelated to cited bug.
2026-01-11Use seq-doseq for iterating over strings in ERCF. Jason Park
* lisp/erc/erc-common.el (erc--doarray): Remove unused function. * lisp/erc/erc.el (erc--channel-mode-types, erc--process-channel-modes) (erc--parse-user-modes): Replace `erc--doarray' with `seq-doseq'. * test/lisp/erc/erc-tests.el (erc--doarray): Remove test.
2026-01-01; Add 2026 to copyright years.Sean Whitton
2025-12-26December 2025 spelling fixesPaul Eggert
Some of the fixes are to continue to use American rather than British spelling. * doc/misc/modus-themes.org (my-modus-themes-engraved-faces): Fix misspelled ‘:foreground’s. * etc/themes/modus-themes.el (modus-themes-faces): Fix misspelled ‘modus-themes-bold’. * lisp/emacs-lisp/rx.el (rx--normalize-char-pattern): Rename from rx--normalise-char-pattern. (rx--optimize-or-args): Rename from rx--optimise-or-args. * lisp/frame.el (frame--special-parameters): Fix misspelled "right-divider-width". * lisp/net/tramp.el (tramp-fingerprint-prompt-regexp): Use American spelling “centered”, to match current libfprintf. * lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers): Rename from org-fold-core--optimise-for-huge-buffers. (org-fold-core-update-optimization): Rename from org-fold-core-update-optimisation, leaving an alias behind. (org-fold-core-remove-optimization): Rename from org-fold-core-remove-optimisation, leaving an alias behind. * lisp/org/org.el (org-advertized-archive-subtree): This alias is now obsolete. * lisp/play/zone.el (zone-ignored-buffers): Fix misspelling of ‘zone--buffer-encrypted-p’. * lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces): Fix misspelling of ‘csharp’ group. * lisp/vc/vc.el (vc-clonable-backends-custom-type): Rename from vc-cloneable-backends-custom-type, leaving an alias behind. * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--warn-arity-non-compiled-callee): Rename from bytecomp-tests--warn-arity-noncompiled-callee. (bytecomp-test-defface-spec): Reword a deliberate misspelling of “default” that is so common I don’t want it to pollute the spelling dictionary. * test/lisp/emacs-lisp/package-vc-tests.el: (package-vc-tests-preserve-artifacts): Rename from package-vc-tests-preserve-artifacts. * test/lisp/eshell/em-prompt-tests.el: (em-prompt-test/forward-backward-paragraph-1): Reword a deliberate misspelling of “goodbye” that is so common I don’t want it to pollute the spelling dictionary.
2025-12-17; Tweak failing autojoin display-context test for ERCF. Jason Park
* test/lisp/erc/erc-scenarios-join-display-context.el (erc-scenarios-join-display-context--errors): Attempt to indirectly fix a reoccurring failure on EMBA. Instead of asserting the membership of `erc-join--requested-channels', have the client attempt to manually join an autojoined channel previously denied by an error response. But this time assert that the display context for the now successfully joined channel doesn't indicate it originated from the autojoin module. * test/lisp/erc/resources/base/gapless-connect/barnet.eld: Increase timeout. * test/lisp/erc/resources/join/buffer-display/mode-context.eld: Update accordingly.
2025-11-02; Skip erc-keep-place-indicator test on Emacs 27F. Jason Park
* 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-10-27Fix regression involving erc-channel-user accessorsF. Jason Park
* etc/ERC-NEWS: New section for ERC 5.6.2 and new entry mentioning slight change in `erc-channel-user' accessor behavior. * lisp/erc/erc-common.el (erc-channel-user): Change type for status slot to natnum from integer. * lisp/erc/erc.el (erc-channel-user-signal-if-status-unknown): New variable. (erc--define-channel-user-status-compat-getter): Only use fallback in Non-ERC buffers because "obviously" a status flag is unusable if the server doesn't advertise it or, rather, advertises nonsupport via its absence. This regression was introduced in ERC 5.6. (erc-channel-begin-receiving-names): Sharp-quote function name. (erc--get-prefix-flag): Mention in doc that a return value of nil can also mean the status flag is not supported by the server. * test/lisp/erc/erc-tests.el (erc--parsed-prefix): Show that it returns nil in a non-ERC buffer. (erc-tests--make-combinations) (erc-tests--with-channel-user-status-accessors): New functions. (erc-channel-user/status-accessors/solo/default) (erc-channel-user/status-accessors/solo/ov) (erc-channel-user/status-accessors/multi/default) (erc-channel-user/status-accessors/multi/ov): New tests. (Bug#67220)
2025-10-22; Prefer EMACS_EMBA_CI for selecting ERC testsF. Jason Park
* test/lisp/erc/erc-scenarios-keep-place-indicator.el (erc-scenarios-keep-place-indicator--follow): * test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp): * test/lisp/erc/erc-tests.el (erc--channel-modes): Use "EMACS_EMBA_CI" for EMBA-specific test selection instead of "CI", which is a Gitlab "predefined" variable absent from .job-template's Docker subprocess.
2025-10-21; Remove unwanted noise from ERC test outputF. Jason Park
Omit newlines and other stray chars, such as "^G", from log output when running tests for ERC non-interactively. * test/lisp/erc/erc-match-tests.el (erc-add-entry-to-list, erc-pals) (erc-fools, erc-keywords, erc-dangerous-hosts): Make `inhibit-message' non-nil when `noninteractive'. * test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic): Make `inhibit-message' non-nil when `noninteractive'. * test/lisp/erc/erc-scenarios-base-buffer-display.el (erc-scenarios-base-buffer-display--interactive-default): Make `inhibit-message' non-nil when `noninteractive'. * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-prompt): Make `inhibit-message' non-nil when `noninteractive'. * test/lisp/erc/erc-services-tests.el (erc-nickserv-get-password): Make `inhibit-message' non-nil when `noninteractive'. * test/lisp/erc/erc-stamp-tests.el (erc-timestamp-intangible--left): Make `inhibit-message' non-nil when `noninteractive'. * test/lisp/erc/erc-tests.el (erc-cmd-UNIGNORE, erc-hide-prompt) (erc--check-prompt-input-for-excess-lines, erc-select-read-args, erc-tls) (erc--interactive, erc-server-select): Make `inhibit-message' non-nil when `noninteractive'. (erc--modify-local-map): Inhibit call to `ding' because it inserts an 07 char, which shows up in the test result logs.
2025-08-25Remove scrolltobottom dependency from erc-fill moduleF. Jason Park
This mostly reverts 9668b4f97c2fc6bfff83258861d455a6d02516a8 "Make erc-fill-wrap depend on scrolltobottom". * etc/ERC-NEWS: Mention removal of formal dependency. * lisp/erc/erc-fill.el (erc-fill--wrap-scrolltobottom-exempt-p): Remove unused variable. (erc-fill--wrap-ensure-dependencies): Remove unused dependency check. (erc-fill-wrap-mode): Remove scrolltobottom dependency from doc string. * test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate): Remove unused binding from var list. * test/lisp/erc/resources/erc-scenarios-common.el (erc-scenarios-common--make-bindings): Remove unused binding.
2025-08-03; Make erc-autojoin-channels-delayed tests more robustF. Jason Park
* test/lisp/erc/erc-join-tests.el (erc-join-tests--autojoin-channels-ident): Be more flexible in checking assertion. (Bug#79017)
2025-07-29; Adjust sleep-for in erc-autojoin-channels testsF. Jason Park
* test/lisp/erc/erc-join-tests.el (erc-join-tests--autojoin-channels-ident): A `sleep-for' value of 0.01 caused associated tests to fail on at least one setup involving Solaris 10. The new value is arbitrary and possibly temporary, pending further investigation. (Bug#79017)
2025-07-27Redo erc-nicks track integration tests as scenariosF. Jason Park
* test/lisp/erc/erc-nicks-tests.el (erc-nicks-tests--track-faces): Remove unused function. (erc-nicks-track-faces/prioritize, erc-nicks-track-faces/defer) (erc-nicks-track-faces/nil, erc-nicks-track-faces/t): Remove tests. * test/lisp/erc/erc-scenarios-nicks-track.el: New file. * test/lisp/erc/resources/nicks/track-prioritize.eld: New file. * test/lisp/erc/resources/nicks/track-t.eld: New file. (Bug#76188)
2025-07-27Cancel ERC autojoin timer in the server bufferF. Jason Park
* lisp/erc/erc-join.el (erc-autojoin-channels-delayed): Only cancel `erc--autojoin-timer' in the server buffer in which it's local. After Emacs 28 brought commit fc66ec33226aeed0b745356363ed952c8ff1f7fd "Prefer defvar-local in erc", customizing `erc-autojoin-timing' to `ident' led to ERC emitting redundant JOINs before `erc-autojoin--join' was factored out. Additionally, don't bother binding options around the call to `erc-autojoin-channels' to shape its behavior, preferring instead to call the internal workhorse function directly. Ever since bug#5521 introduced those options, the logic in `erc-autojoin-channels' has ignored `erc-autojoin-delay' anyway, so long as `erc-autojoin-timing' isn't `ident'. This change may break third party advice. (erc-autojoin-after-ident): Restore code to cancel timer. It was erroneously deleted in 959fbcf34b5dd04e1b4bf87c0b73afd784a41f7f "favor network identities in erc-join". * test/lisp/erc/erc-join-tests.el: Require erc-tests-common atop file so tests can take advantage of common utilities. (erc-autojoin-channels--connect): Replace with a function and three separate tests. (erc-join-tests--autojoin-channels-connect): New function. (erc-autojoin-channels/server, erc-autojoin-channels/network) (erc-autojoin-channels/nomatch): New tests. (erc-autojoin-channels--delay): Replace with a function and three separate tests. Remove guard to skip test on Solaris. (erc-join-tests--autojoin-channels-ident): New function. (erc-autojoin-channels-delayed/server) (erc-autojoin-channels-delayed/network) (erc-autojoin-channels-delayed/nomatch): New tests. (erc-autojoin-channels--ident): Replace with function and two separate tests. (erc-join-tests--autojoin-after-ident): New function. (erc-autojoin-after-ident/server) (erc-autojoin-after-ident/network): New tests. (erc-join-tests--autojoin-add--common) (erc-join-tests--autojoin-add): Rename former to latter. (erc-autojoin-add--network) (erc-autojoin-add--network-extended-syntax) (erc-autojoin-add--network-id): Adjust arguments to fixture. (erc-autojoin-add--server): Use common utils. (erc-join-tests--autojoin-remove--common) (erc-join-tests--autojoin-remove): Rename former to latter. (erc-autojoin-remove--network) (erc-autojoin-remove--network-id): Adjust args for fixture. (erc-autojoin-remove--server): Use common utils. * test/lisp/erc/erc-scenarios-join-timing.el: New file. * test/lisp/erc/resources/erc-scenarios-common.el (erc-scenarios-common--run-in-term): In subprocess, don't use failure tally as exit status unless body form succeeds. * test/lisp/erc/resources/erc-tests-common.el (erc-tests-common-init-server-proc): Use `make-process' instead of `start-process'. (erc-tests-common-make-server-buf): Use `erc-server-current-nick' to create the `erc-networks--id' as a `erc-networks--id-qualifying' instance, which is more realistic than a "fixed" variant. * test/lisp/erc/resources/join/timing/connect-both.eld: New file. * test/lisp/erc/resources/join/timing/ident-both.eld: New file. (Bug#79017)
2025-07-16; Skip erc-autojoin-channels--delay test on SolarisF. Jason Park
* test/lisp/erc/erc-join-tests.el (erc-autojoin-channels--delay): Skip for now on Solaris and UnixWare pending further investigation. (Bug#79017)
2025-04-16Don't round-trip auto-reconnect probe in ERCF. Jason Park
* lisp/erc/erc-backend.el (erc-server--reconnect-opened) (erc--server-reconnect-opened): Rename former to latter. Restore original buffer-local value of session connector for Emacs 29 and below. (erc--server-reconnect-timeout-check) (erc--server-reconnect-timeout-scale-function): Change from buffer-local to normal variables, which they should have been originally. (erc--recon-probe-reschedule): Ensure `erc-server-reconnect-timeout' is always non-nil to avoid seeing format specifier in admin message. Use current buffer when `proc' argument is nil. Perform cleanup when `proc' and `erc-server-process' differ. (erc-server-delayed-check-reconnect-reuse-process-p): New variable. (erc--recon-probe-sentinel): Run `erc--server-reconnect-opened' immediately because sending a speculative PING doesn't work on all servers and proxies, most crucially on ZNC, which replies with an error only after an extended timeout. (erc--recon-probe-filter): Remove unused function. (erc--recon-probe-check) Rework to not use fixed periodic timer, change second parameter to a Lisp time object. (erc-server-delayed-check-reconnect): Use realistic name when reusing process so that the session's process isn't "*erc-connectivity-check*". Set filter to `ignore'. Always run `erc--recon-probe-sentinel' when status is `open' or something other than `connect', but don't bother spawning a `erc--recon-probe-check' task as well because any problems creating the process should already be known. Handle quits during connect functions that perform blocking I/O, such as `socks-open-network-stream'. (erc-schedule-reconnect): Don't bother setting filter to nil. * test/lisp/erc/erc-scenarios-base-auto-recon.el (erc-scenarios-base-auto-recon-unavailable) (erc-scenarios-base-auto-recon-check/no-reuse): Rename former to latter. (erc-scenarios-base-auto-recon-no-proto) (erc-scenarios-base-auto-recon-check/reuse): Rename former to latter and rewrite not to expect a PING. * test/lisp/erc/resources/erc-d/erc-d.el (erc-d--forget-process): New function. (erc-d--process-sentinel): Stop serving when all dialogs have been exhausted. (Bug#62044)
2025-04-16; Don't assume snapshot exists in ERC test helperF. Jason Park
* test/lisp/erc/erc-scenarios-base-association.el (erc-scenarios-common--base-association-multi-net): Increase timeout. * test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el (erc-scenarios-common--base-compat-no-rename-bouncer): Increase timeout. * test/lisp/erc/erc-scenarios-keep-place-indicator.el (erc-scenarios-keep-place-indicator--follow): Skip in CI. * test/lisp/erc/resources/erc-d/resources/incremental.eld: Increase timeout. * test/lisp/erc/resources/erc-tests-common.el (erc-tests-common-snapshot-compare): Forgo inserting file if generating snapshot interactively because it may not yet exist.
2025-03-11Suppress log module when inserting date stamps in ERCF. Jason Park
* lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Use `make-obsolete-variable' because `erc-truncate-buffer-on-save' is an option, not a function. Already mentioned in etc/ERC-NEWS. (erc-logging-enabled): Return nil if `log' appears in the `erc--skip' msg prop. * lisp/erc/erc-stamp.el (erc-stamp--defer-date-insertion-on-post-modify): Add `log' to `erc--skip' msg prop. This tells the log module to defer advancing the `erc-last-saved-position' marker until after stamps have been inserted, thus ensuring they're included in logs when `erc-log-write-after-insert' is non-nil. * test/lisp/erc/erc-scenarios-log.el (erc-scenarios-log--save-buffer-in-logs/truncate-on-save): Suppress warning for `erc-truncate-buffer-on-save'. (erc-scenarios-log--write-after-insert): New test. (Bug#76875)
2025-03-04; Use ert-skip instead of skip-when in erc-match testF. Jason Park
* test/lisp/erc/erc-match-tests.el (erc-add-entry-to-list): The local macro `skip-when' first appeared in Emacs 30, but ERC supports Emacs 27+ and runs its test suite on all supported versions. * test/lisp/erc/erc-scenarios-keep-place-indicator.el (erc-scenarios-keep-place-indicator--follow): Temporarily tag as :unstable in all CI environments.
2025-03-03; Adapt another test to AndroidPo Lu
* test/lisp/erc/erc-match-tests.el (erc-add-entry-to-list): Skip on Android as it hangs for reasons unknown.
2025-03-02; Adapt more tests for AndroidPo Lu
* test/infra/android/test-controller.el (ats-eval): Document new values of ats-eval. (ats-run-test): Report conditions where tests induce Emacs to exit. * test/lisp/erc/resources/erc-tests-common.el (erc-tests-common-kill-buffers): Bind kill-buffer-query-functions to nil.
2025-02-24; Tag all erc-nicks-track-faces tests as :unstableF. Jason Park
* test/lisp/erc/erc-nicks-tests.el (erc-nicks-track-faces/prioritize): Tag as :unstable, regardless of environment, pending further investigation. This has reportedly failed on Emacs 31 and Emacs 28. (erc-nicks-track-faces/defer, erc-nicks-track-faces/nil): Tag as :unstable even though there haven't been any reported failures as yet. (erc-nicks-track-faces/t): Likewise. This test has failed on Emacs 31 on a GitLab.com runner. (Bug#76188)
2025-02-10; Mark erc-nicks test as :unstableF. Jason Park
* test/lisp/erc/erc-nicks-tests.el (erc-nicks-track-faces/prioritize): Mark as :unstable outside of EMBA and ERC's own CI. (Bug#76188)
2025-02-07; Make ERC test fixture more robustF. Jason Park
* test/lisp/erc/erc-tests.el (erc-tests--assert-printed-in-subprocess): Scan for sentinel before reading. (erc--find-mode, erc--essential-hook-ordering): Use contrived :result protocol expected by `erc-tests--assert-printed-in-subprocess'. * test/lisp/erc/resources/erc-tests-common.el (erc-tests-common-create-subprocess): Divert stderr to messages buffer.
2025-02-07More clearly define local module behavior in ERCF. Jason Park
* doc/misc/erc.texi (Modules): Label all local modules as being such. Move `querypoll' to the auxiliary section. Rework entire "Local Modules" portion. * lisp/erc/erc-goodies.el (erc-keep-place-indicator-mode) (erc-command-indicator-mode): Mention what buffer types they operate in. * lisp/erc/erc-nicks.el (erc-nicks-mode): Mention the mode is enabled in all buffers. * lisp/erc/erc-notify.el (erc-querypoll-mode): Mention which buffers it operates in. * lisp/erc/erc-sasl.el (erc-sasl-mode): Disable completely in target buffers so its mode variable is nil. * lisp/erc/erc-services.el (erc-services-regain-mode): Disable in target buffers. * lisp/erc/erc.el (erc-open): When activating local modules, skip those that have just been enabled by a fellow module. Do this even though their setup code is meant to be idempotent. * test/lisp/erc/erc-scenarios-base-local-modules.el (erc-scenarios-base-local-modules--toggle-helpers): Revise to assert current behavior. (Bug#57955)
2025-02-02Run erc-services-regain-mode callback on a timerF. Jason Park
* lisp/erc/erc-services.el (erc-services-regain-timeout-seconds): New variable. (erc-services-regain-mode): Mention CertFP in doc string. (erc--nickname-in-use-make-request): Ensure the 900 RPL_LOGGEDIN callback always runs after `erc-services-regain-timeout-seconds', even when SASL isn't being used. * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-misc--regain-command/oftc): New test. * test/lisp/erc/resources/services/regain/taken-regain-oftc.eld: New file.
2025-01-22; Don't quote localp argument to define-erc-moduleF. Jason Park
* etc/ERC-NEWS: Rearrange some entries for 5.6.1. * lisp/erc/erc-fill.el (erc-fill-wrap-mode): * lisp/erc/erc-goodies.el (erc-keep-place-indicator-mode) (erc-command-indicator-mode): * lisp/erc/erc-nicks.el (erc-nicks-mode): * lisp/erc/erc-notify.el (erc-querypoll-mode): * lisp/erc/erc-sasl.el (erc-sasl-mode): * lisp/erc/erc-services.el (erc-services-regain-mode): Don't quote localp argument. * test/lisp/erc/erc-scenarios-misc.el (erc-nicks-track-faces/defer): Skip on Emacs 27 due to recent CI failures. * test/lisp/erc/erc-scenarios-misc.el (erc-scenarios-base-flood): Adjust timeout.
2025-01-07; Mark ERC keep-place-indicator test as :unstableF. Jason Park
* test/lisp/erc/erc-scenarios-keep-place-indicator.el (erc-scenarios-keep-place-indicator--follow): Don't run on EMBA pending investigation of test timing out.
2025-01-07Improve use of Flyspell's API in erc-spellingF. Jason Park
* etc/ERC-NEWS: Announce deprecation of `erc-spelling-flyspell-verify' and `erc-spelling-unhighlight-word'. A slight behavioral change not worth mentioning is that, previously, ERC arranged for Flyspell to ignore any word immediately following a forward slash anywhere in the prompt input, even those for which the slash served as mere punctuation (a "stroke"), as in "something/misspelt." As of this change, Flyspell only unconditionally exempts an initial slash-prepended word, like "tableflip" in "ERC> /tableflip", and checks all others that follow against known slash commands. * lisp/erc/erc-spelling.el: Change top-level assignment of `erc-mode' symbol-property `flyspell-mode-predicate' from `erc-spelling-flyspell-verify' to `erc-spelling--flyspell-input-p'. (erc-spelling-mode, erc-spelling-disable): Remove local member from `flyspell-incorrect-hook'. (erc-spelling-init): Add `erc-spelling--flyspell-check' to `flyspell-incorrect-hook' locally. Don't bother explicitly setting `flyspell-generic-check-word-predicate' because Flyspell already does that for clients using the `flyspell-mode-predicte' interface. (erc-spelling-flyspell-verify, erc-spelling-unhighlight-word): Mark obsolete. (erc-spelling--flyspell-check, erc-spelling--flyspell-input-p): New functions, essentially the two halves of a reworked and bifurcated `erc-spelling-flyspell-verify'. Though used as a predicate, the first is not named as such because it performs side effects. * test/lisp/erc/erc-scenarios-spelling.el: New file. * test/lisp/erc/resources/spelling/auto-correct.eld: New file. (Bug#75327)
2025-01-07Fix regression in erc-nicks involving color poolsF. Jason Park
* lisp/erc/erc-nicks.el (erc-nicks-colors): Tweak doc. (erc-nicks--create-pool-function): On graphic displays, set value to `erc-nicks--create-culled-pool', the original default. This fixes a bug in which ERC mapped all pool members to a primary color, thus excluding the bulk of them. Thanks to Trevor Arjeski for discovering it. (erc-nicks--create-coerced-pool): Mention the text-terminal-only requirement in doc. (erc-nicks-refresh): Improve doc. * test/lisp/erc/erc-nicks-tests.el (erc-nicks-tests--track-faces): Enable `erc-track-mode' prior to running body.
2025-01-01Update copyright year to 2025Paul Eggert
Run "TZ=UTC0 admin/update-copyright".
2024-12-27Reuse process in erc-server-delayed-check-reconnectF. Jason Park
* doc/misc/erc.texi (Integrations): Set `erc-server-reconnect-function' to `erc-server-delayed-check-reconnect' in SOCKS example, and add definition for `erc-open-socks-tls-stream'. Mention possible inaccuracies related to error detection with certain reconnect strategies. * lisp/erc/erc-backend.el (erc-server--reconnect-opened): New function. (erc-server-delayed-check-reconnect): Attempt to reuse process if server sends a complete PONG, and attempt to accommodate connectors that set :nowait to nil. (erc--server-delayed-check-connectors): Remove variable. (erc-server-prefer-check-reconnect): Inline what was the internal variable `erc--server-delayed-check-connectors' because it's no longer used in unit tests. Add `erc-open-socks-tls-stream' to the set of connector functions thought to be compatible with the "check" reconnect strategy. * test/lisp/erc/erc-scenarios-base-auto-recon.el (erc-scenarios-base-auto-recon-no-proto): Adapt to expect "reuse" behavior. * test/lisp/erc/resources/base/reconnect/ping-pong.eld: Delete unused file. * test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld: Capture PING cookie to send back to client. * test/lisp/erc/resources/erc-d/resources/proxy-solo.eld: Delete unused file. (Bug#62044)
2024-12-20Use smarter default for erc-server-reconnect-functionF. Jason Park
* doc/misc/erc.texi (Sample Configuration): Remove customization in `use-package' declaration for `erc-server-reconnect-function' as well as related language in the customization walk-through. Do this because the new default incorporates `erc-server-delayed-check-reconnect' behavior for compatible connect functions. * etc/ERC-NEWS: Announce new default for `erc-server-reconnect-function'. * lisp/erc/erc-backend.el (erc-server-reconnect-function): Change default to `erc-server-prefer-check-reconnect'. (erc-server-delayed-check-reconnect): Use `process-send-string' instead of `send-string'. (erc--server-delayed-check-connectors): New variable. (erc-server-prefer-check-reconnect): New function. * test/lisp/erc/erc-scenarios-base-auto-recon.el (erc-scenarios-base-auto-recon-unavailable) (erc-scenarios-base-auto-recon-no-proto): Remove unnecessary `erc-server-reconnect-function' binding because the new default incorporates the behavior being tested for. * test/lisp/erc/erc-scenarios-base-buffer-display.el (erc-scenarios-base-buffer-display--reconnect-common): * test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el (erc-scenarios-common--base-compat-no-rename-bouncer): * test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-base.el (erc-scenarios-base-netid-bouncer--recon-base): * test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-both.el (erc-scenarios-base-netid-bouncer--recon-both): * test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-id.el (erc-scenarios-base-netid-bouncer--reconnect-id-foo) (erc-scenarios-base-netid-bouncer--reconnect-id-bar): * test/lisp/erc/erc-scenarios-base-reconnect.el (erc-scenarios-base-reconnect-timer) (erc-scenarios-base-cancel-reconnect): * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-misc--reconnect-retry-nick): * test/lisp/erc/erc-scenarios-stamp.el (erc-scenarios-stamp--date-mode/reconnect): Explicitly bind `erc-server-reconnect-function' to `erc-server-delayed-reconnect', the former default, which does not do any probing. (Bug#62044)
2024-12-20Add command for teaching Imenu about ERC macrosF. Jason Park
* lisp/erc/erc-backend.el (define-erc-response-handler): Add `doc-string' to `declare' specification. * test/lisp/erc/resources/erc-tests-common.el (erc-tests-common-add-imenu-expressions): New function for defining and undefining Imenu patterns useful to ERC developers.
2024-12-09; Mark failing tests in erc-scenarios-match.el as :unstableF. Jason Park
* test/lisp/erc/erc-scenarios-match.el (erc-scenarios-match--stamp-both-invisible-fill-static) (erc-scenarios-match--stamp-both-invisible-fill-static--nooffset): Tag as :unstable for a `system-type' of `berkeley-unix'. (Bug#74722)
2024-12-09; Slightly improve test case for erc-parse-modesF. Jason Park
* lisp/erc/erc.el (erc--merge-local-modes): Look for a symbol's `erc-module' property before examining its name. * test/lisp/erc/erc-tests.el (erc-parse-modes): Expand case to cover alternating plus and minus mode changes.
2024-12-01Reserve erc-normalize-port for equality comparisonsF. Jason Park
* etc/ERC-NEWS: Add entry explaining changes to entry point 'erc-tls' and library functions `erc-normalize-port' and `erc-compute-port'. * lisp/erc/erc.el (erc-normalize-port): Map "ircu" to 6665 instead of 6667, and add related IANA service mappings. Return 0 for unknown nonempty strings. (erc-open): Pass `erc-session-port' through `erc-string-to-port' before handing it to `erc-server-connect'. This prevents the network machinery from ever seeing a numeric string, like "6667". (erc-select-read-args): Since `erc-compute-port' no longer relies on `erc-normalize-port', ensure its input is a number. Use `erc-port-equal' instead of `eql'. (erc-tls): Respect a configured non-nil `erc-port' option when the user does not provide a :port keyword argument from Lisp code. (erc-determine-parameters): Use `erc-compute-port' for initializing `erc-session-port'. (erc-compute-port): Don't pass the result through `erc-normalize-port', which can convert it to an unintuitive form. (erc--url-default-connect-function): Use `erc-compute-port' instead of `erc-normalize-port'. (erc-handle-irc-url): Use `erc-port-equal' for comparison. * test/lisp/erc/erc-scenarios-auth-source.el (erc-scenarios-common--auth-source): Allow tests to convey the automatic port number to `erc-open' via `erc-port'. (erc-scenarios-base-auth-source-server--dialed): Use `erc-port' option instead of passing a :port parameter to entry-point command. * test/lisp/erc/erc-tests.el (erc-normalize-port): New test. (Bug#74516)