diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index a1f84ee5165..e2b7c0b6f48 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -885,7 +885,7 @@ Expect BUFFER to be the server buffer for the current connection." (time-convert nil 'integer)))) ((or "connection broken by remote peer\n" (rx bot "failed")) - (funcall reschedule proc))))) + (run-at-time nil nil reschedule proc))))) (filter (lambda (proc _) (delete-process proc) (with-current-buffer buffer diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 4ba7990ab98..3577e697515 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -191,7 +191,7 @@ widget runs its set function.") "Be more nuanced in displaying Custom state of `erc-modules'. When `customized-value' differs from `saved-value', allow widget to behave normally and show \"SET for current session\", as -though `customize-set-variable' or similar had been applied. +though `customize-set-variable' or similar has been applied. However, when `customized-value' and `standard-value' match but differ from `saved-value', prefer showing \"CHANGED outside Customize\" to prevent the widget from seeing a `standard' @@ -207,7 +207,7 @@ instead of a `set' state, which precludes any actual saving." (funcall (get 'erc-modules 'custom-set) 'erc-modules (funcall op (erc--normalize-module-symbol name) erc-modules)) (when (equal (pcase (get 'erc-modules 'saved-value) - (`((quote ,saved) saved))) + (`((quote ,saved)) saved)) erc-modules) (customize-mark-as-set 'erc-modules))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index b375df1edb6..2deaedae955 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2951,15 +2951,16 @@ PARAMETERS should be a sequence of keywords and values, per (defun erc-open-socks-tls-stream (name buffer host service &rest parameters) "Connect to an IRC server via SOCKS proxy over TLS. -Defer to the `socks' and `gnutls' libraries to make the actual -connection and perform TLS negotiation. Expect SERVICE to be a -TLS port number and that the plist PARAMETERS contains a -`:client-certificate' pair when necessary. Otherwise, assume the -arguments NAME, BUFFER, and HOST to be acceptable to -`open-network-stream' and that users know to check out -`erc-server-connect-function' and Info node `(erc) SOCKS' for -more info, including an important example of how to \"wrap\" this -function with SOCKS credentials." +Perform the duties required of an `erc-server-connect-function' +implementer, and return a network process. Defer to the `socks' +and `gnutls' libraries to make the connection and handle TLS +negotiation. Expect SERVICE to be a TLS port number and +PARAMETERS to be a possibly empty plist containing items like a +`:client-certificate' pair. Pass NAME, BUFFER, and HOST directly +to `open-network-stream'. Beyond that, operate as described in +Info node `(erc) SOCKS', and expect users to \"wrap\" this +function with `let'-bound credentials when necessary, as shown in +the example." (require 'gnutls) (require 'socks) (let ((proc (socks-open-network-stream name buffer host service)) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index f393402fe81..f4cff06f942 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -164,15 +164,6 @@ (advice-remove 'buffer-local-value 'erc-with-server-buffer))) -(ert-deftest erc--with-dependent-type-match () - (should (equal (macroexpand-1 - '(erc--with-dependent-type-match (repeat face) erc-match)) - '(backquote-list* - 'repeat :match (lambda (w v) - (require 'erc-match) - (widget-editable-list-match w v)) - '(face))))) - (ert-deftest erc--doarray () (let ((array "abcdefg") out) @@ -1269,23 +1260,6 @@ (should-not (erc--valid-local-channel-p "#chan")) (should (erc--valid-local-channel-p "&local"))))) -;; FIXME remove this because it serves no purpose. See bug#71178. -(ert-deftest erc--restore-initialize-priors () - (unless (>= emacs-major-version 28) - (ert-skip "Lisp nesting exceeds `max-lisp-eval-depth'")) - (should (pcase (macroexpand-1 '(erc--restore-initialize-priors erc-my-mode - foo (ignore 1 2 3) - bar #'spam - baz nil)) - (`(let* ((,p (or erc--server-reconnecting erc--target-priors)) - (,q (and ,p (alist-get 'erc-my-mode ,p)))) - (unless (local-variable-if-set-p 'erc-my-mode) - (error "Not a local minor mode var: %s" 'erc-my-mode)) - (setq foo (if ,q (alist-get 'foo ,p) (ignore 1 2 3)) - bar (if ,q (alist-get 'bar ,p) #'spam) - baz (if ,q (alist-get 'baz ,p) nil))) - t)))) - (ert-deftest erc--target-from-string () (should (equal (erc--target-from-string "#chan") #s(erc--target-channel "#chan" \#chan nil))) diff --git a/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld b/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld index 15bcca2a623..78697d6f2c9 100644 --- a/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld +++ b/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld @@ -33,7 +33,7 @@ (0.0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.") (0.0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) -((mode 3 "MODE #chan") +((mode-chan 10 "MODE #chan") (1.0 ":irc.foonet.org 324 tester #chan +nt") (0.0 ":irc.foonet.org 329 tester #chan 1623816901") (0.1 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :bob: At thy good heart's oppression.") diff --git a/test/lisp/erc/resources/base/mask-target-routing/foonet.eld b/test/lisp/erc/resources/base/mask-target-routing/foonet.eld index 796d5566b65..7b5796129f7 100644 --- a/test/lisp/erc/resources/base/mask-target-routing/foonet.eld +++ b/test/lisp/erc/resources/base/mask-target-routing/foonet.eld @@ -17,7 +17,7 @@ (0 ":irc.foonet.org 266 tester 4 4 :Current global users 4, max 4") (0 ":irc.foonet.org 422 tester :MOTD File is missing")) -((mode-user 1.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") ;; No mode answer (0 ":irc.znc.in 306 tester :You have been marked as being away") (0 ":tester!~u@gq7yjr7gsu7nn.irc JOIN #foo") diff --git a/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld b/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld index 386d0f4b085..80903f94155 100644 --- a/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld +++ b/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld @@ -1,4 +1,8 @@ ;; -*- mode: lisp-data; -*- + +((~eof 60 EOF)) +((~ping 60 "PING")) + ((nick 10 "NICK tester")) ((user 10 "USER user 0 * :tester") (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") diff --git a/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld b/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld index 3711eb8f8e6..4b7db5a91b1 100644 --- a/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld +++ b/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld @@ -10,13 +10,13 @@ (0.22 ":soju.im 221 tester +Zi") (0.00 ":soju.im 422 tester :Use /motd to read the message of the day")) -((mode 5 "MODE tester +i") +((mode-tester 5 "MODE tester +i") (0.00 ":tester!tester@10.0.2.100 JOIN #chan") (0.06 ":soju.im 353 tester = #chan :tester @mike joe") (0.01 ":soju.im 366 tester #chan :End of /NAMES list") (0.23 ":irc.barnet.org 221 tester +Zi")) -((mode 5 "MODE #chan") +((mode-chan-a 5 "MODE #chan") (0.00 ":soju.im 324 tester #chan +tn") (0.01 ":soju.im 329 tester #chan 1652878846") (0.01 ":joe!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :mike: There is five in the first show.") @@ -49,7 +49,7 @@ ;; Server-initialed join (0.01 ":tester!tester@10.0.2.100 JOIN #chan")) -((mode 5 "MODE #chan") +((mode-chan-b 5 "MODE #chan") (0.22 ":soju.im 353 tester = #chan :@mike joe tester") (0.00 ":soju.im 366 tester #chan :End of /NAMES list") (0.00 ":soju.im 324 tester #chan +nt") diff --git a/test/lisp/erc/resources/erc-scenarios-common.el b/test/lisp/erc/resources/erc-scenarios-common.el index c7d5c9d6677..0dc82c98d5f 100644 --- a/test/lisp/erc/resources/erc-scenarios-common.el +++ b/test/lisp/erc/resources/erc-scenarios-common.el @@ -144,6 +144,7 @@ (quit . ,(erc-quit/part-reason-default)) (erc-version . ,erc-version))) (erc-modules (copy-sequence erc-modules)) + (debug-on-error t) (inhibit-interaction noninteractive) (auth-source-do-cache nil) (timer-list (copy-sequence timer-list)) diff --git a/test/lisp/erc/resources/join/network-id/barnet.eld b/test/lisp/erc/resources/join/network-id/barnet.eld index ad6a7c820a9..3d13c7a6296 100644 --- a/test/lisp/erc/resources/join/network-id/barnet.eld +++ b/test/lisp/erc/resources/join/network-id/barnet.eld @@ -1,5 +1,5 @@ ;; -*- mode: lisp-data; -*- -((pass 2 "PASS :barnet:changeme")) +((pass 10 "PASS :barnet:changeme")) ((nick 2 "NICK tester")) ((user 1 "USER user 0 * :tester") (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester")