]> git.eshelyaron.com Git - emacs.git/commit
Reserve erc-normalize-port for equality comparisons
authorF. Jason Park <jp@neverwas.me>
Mon, 25 Nov 2024 08:01:04 +0000 (00:01 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Dec 2024 17:02:21 +0000 (18:02 +0100)
commit8c7013a67ee256c63e9d16208e6fc24356540eb8
treee57dcfb9bea61b0d2c5ced267ddcbc3553db8eb7
parente3ec6b24f37f4b1721bc47110fe3f787a7af7f0f
Reserve erc-normalize-port for equality comparisons

* 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)

(cherry picked from commit 3bf4ea9543fedb7d3af42d37c853a6f29c681523)
etc/ERC-NEWS
lisp/erc/erc.el
test/lisp/erc/erc-scenarios-auth-source.el
test/lisp/erc/erc-tests.el