[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix/bug-48598 6ece132c35 09/27: Require erc-networks in erc.el
From: |
F. Jason Park |
Subject: |
fix/bug-48598 6ece132c35 09/27: Require erc-networks in erc.el |
Date: |
Fri, 8 Apr 2022 03:06:47 -0400 (EDT) |
branch: fix/bug-48598
commit 6ece132c35718e9ed72f4627a2d4756d2f4689a0
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Require erc-networks in erc.el
* lisp/erc/erc.el: Require erc-networks.el, which ERC can't run
without these days. To sidestep the circular dependency, require it
last, just after erc-goodies. Remove the `declare-function' for
`erc-network-name' because it's not currently needed at load time.
(erc-log-irc-protocol, erc-hide-current-message-p,
erc-handle-irc-url): Remove `fboundp' guard logic from
`erc-network-name' invocations but preserve meaning by interpreting
`erc-network' being unset to mean module isn't loaded or authoritative
network detection has failed.
(erc-format-network): Likewise here because, ATM, this function always
returns "" because the function `erc-network-name' always returns
non-nil, perhaps from the fallback/failure sentinel "Unknown", perhaps
from the printed form of nil.
* lisp/erc/erc-networks.el (erc-network): Don't autoload
`erc-determine-network', which only runs once per session and for
which third-party code has no valid use. OTOH, the function
`erc-network' is used throughout erc.el but was previously cumbersome
due to being guarded by fboundp.
---
lisp/erc/erc-networks.el | 3 +--
lisp/erc/erc.el | 14 ++++----------
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 553697ae84..06ba3165a4 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -733,7 +733,6 @@ MATCHER is used to find a corresponding network to a server
while
;; Functions:
-;;;###autoload
(defun erc-determine-network ()
"Return the name of the network or \"Unknown\" as a symbol.
Use the server parameter NETWORK if provided, otherwise parse the
@@ -753,7 +752,7 @@ server name and search for a match in `erc-networks-alist'."
(defun erc-network ()
"Return the value of `erc-network' for the current server."
- (erc-with-server-buffer erc-network))
+ (or erc-network (erc-with-server-buffer erc-network)))
(defun erc-network-name ()
"Return the name of the current network as a string."
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 4ef6ec9635..6688a547d4 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2377,8 +2377,6 @@ but you won't see it.
WARNING: Do not set this variable directly! Instead, use the
function `erc-toggle-debug-irc-protocol' to toggle its value.")
-(declare-function erc-network-name "erc-networks" ())
-
(defun erc-log-irc-protocol (string &optional outbound)
"Append STRING to the buffer *erc-protocol*.
@@ -2392,9 +2390,7 @@ contain CRLF endings. Peer is identified by the most
precise label
available at run time, starting with the network name, followed by the
announced host name, and falling back to the dialed <server>:<port>."
(when erc-debug-irc-protocol
- (let ((esid (or (and (fboundp 'erc-network)
- (erc-network)
- (erc-network-name))
+ (let ((esid (or (and (erc-network) (erc-network-name))
erc-server-announced-name
(format "%s:%s" erc-session-server erc-session-port)))
(ts (when erc-debug-irc-protocol-time-format
@@ -2797,7 +2793,7 @@ returns non-nil."
(let* ((command (erc-response.command parsed))
(sender (car (erc-parse-user (erc-response.sender parsed))))
(channel (car (erc-response.command-args parsed)))
- (network (or (and (fboundp 'erc-network-name) (erc-network-name))
+ (network (or (and (erc-network) (erc-network-name))
(erc-shorten-server-name
(or erc-server-announced-name
erc-session-server))))
@@ -6517,10 +6513,7 @@ This should be a string with substitution variables
recognized by
(defun erc-format-network ()
"Return the name of the network we are currently on."
- (let ((network (and (fboundp 'erc-network-name) (erc-network-name))))
- (if (and network (symbolp network))
- (symbol-name network)
- "")))
+ (erc-network-name))
(defun erc-format-target-and/or-network ()
"Return the network or the current target and network combined.
@@ -7074,5 +7067,6 @@ Otherwise, connect to HOST:PORT as USER and /join
CHANNEL."
;; IMPORTANT: This require must appear _after_ the above (provide 'erc) to
;; avoid a recursive require error when byte-compiling the entire package.
(require 'erc-goodies)
+(require 'erc-networks)
;;; erc.el ends here
- fix/bug-48598 6ee4329b46 02/27: Initialize erc-server-filter-data in erc-backend, (continued)
- fix/bug-48598 6ee4329b46 02/27: Initialize erc-server-filter-data in erc-backend, F. Jason Park, 2022/04/08
- fix/bug-48598 3c6694d114 20/27: Don't call erc-auto-query twice on PRIVMSG, F. Jason Park, 2022/04/08
- fix/bug-48598 50b3aa88fc 11/27: Recognize ascii and strict CASEMAPPINGs in ERC, F. Jason Park, 2022/04/08
- fix/bug-48598 f9794dea43 15/27: Discourage ill-defined use of buffer targets in ERC, F. Jason Park, 2022/04/08
- fix/bug-48598 bb117dfacb 05/27: [SQUASH-ME] Remove duplicate ERC prompt on reconnect, F. Jason Park, 2022/04/08
- fix/bug-48598 c25371f9d7 08/27: Don't set erc-server-announced-name unless known, F. Jason Park, 2022/04/08
- fix/bug-48598 8558f9434a 12/27: Make ERC respect spaces in server passwords, F. Jason Park, 2022/04/08
- fix/bug-48598 a9ef01ec76 06/27: Customize displaying of ERC buffers on reconnect, F. Jason Park, 2022/04/08
- fix/bug-48598 eef4fa00e8 01/27: Rework mutual dependency between erc and erc-backend, F. Jason Park, 2022/04/08
- fix/bug-48598 31030f2568 14/27: Add eventual replacement for erc-default-recipients, F. Jason Park, 2022/04/08
- fix/bug-48598 6ece132c35 09/27: Require erc-networks in erc.el,
F. Jason Park <=
- fix/bug-48598 346381ffe5 17/27: Address long-standing ERC buffer-naming issues, F. Jason Park, 2022/04/08
- fix/bug-48598 bd8efa668b 18/27: SQUASH-ME: Add user-oriented test scenarios for ERC, F. Jason Park, 2022/04/08
- fix/bug-48598 242c8374b0 22/27: Favor network identities in erc-join, F. Jason Park, 2022/04/08
- fix/bug-48598 11e9bb2b2f 25/27: SQUASH-ME: Add ERC test scenarios involving auth-source, F. Jason Park, 2022/04/08
- fix/bug-48598 ab2d93e564 27/27: Update ERC's Info doc with network-ID related changes, F. Jason Park, 2022/04/08
- fix/bug-48598 dd5a99e891 26/27: SQUASH-ME: Add ERC test scenario for erc-cmd-JOIN, F. Jason Park, 2022/04/08