Allow querying auth-source with port as string in ERC

* lisp/erc/erc.el (erc--auth-source-determine-params-defaults): Allow
arbitrary strings for `ers-session-port'.  Previously, if a port/service
was any string other than "irc", the auth-source query would fail for a
seemingly unknown reason.  Restricting the value to "irc" is unnecessary
since "irc" is already added to the list of ports, and
`make-network-process' already consults /etc/services for well-known
service names, like "ircs-u", etc.  This change allows a user to (setopt
erc-port "1234"), intentionally or accidentally, while still being able
to use .authinfo for password management.  (Bug#74516)

Copyright-paperwork-exempt: yes
This commit is contained in:
Trevor Arjeski 2024-11-24 23:35:41 +03:00 committed by F. Jason Park
parent e0d2c6f20f
commit d899519221

View file

@ -4674,8 +4674,9 @@ node `(erc) auth-source'."
(list net erc-server-announced-name erc-session-server)))
(ports (list (cl-typecase erc-session-port
(integer (number-to-string erc-session-port))
(string (and (string= erc-session-port "irc")
erc-session-port)) ; or nil
(string (and (not (member erc-session-port
'("" "irc")))
erc-session-port))
(t erc-session-port))
"irc")))
(list (cons :host (delq nil hosts))