[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 485b84cb7c 08/25: Require erc-networks in erc.el
From: |
F. Jason Park |
Subject: |
master 485b84cb7c 08/25: Require erc-networks in erc.el |
Date: |
Thu, 30 Jun 2022 18:29:52 -0400 (EDT) |
branch: master
commit 485b84cb7c4c61b434273fc25be0a25b84fca31d
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): 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. At the moment, this function
always returns the empty string 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): This is called throughout
erc.el but was previously cumbersome to use on account of being
guarded by `fboundp'. It now relies on the fact that its namesake
variable is set in target buffers as well.
---
lisp/erc/erc-networks.el | 2 +-
lisp/erc/erc.el | 14 ++++----------
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 553697ae84..58223f37cf 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -753,7 +753,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 7f102dcefb..a23ff5e059 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2388,8 +2388,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*.
@@ -2403,9 +2401,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
@@ -2808,7 +2804,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))))
@@ -6528,10 +6524,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.
@@ -7085,5 +7078,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
- master c5b78a3379 05/25: Customize displaying of ERC buffers on reconnect, (continued)
- master c5b78a3379 05/25: Customize displaying of ERC buffers on reconnect, F. Jason Park, 2022/06/30
- master 4ae0707704 03/25: Accept user keyword arg in ERC entry-point commands, F. Jason Park, 2022/06/30
- master a63ed6f78a 04/25: Remove duplicate ERC prompt on reconnect, F. Jason Park, 2022/06/30
- master de53d18a4d 07/25: Don't set erc-server-announced-name unless known, F. Jason Park, 2022/06/30
- master 873499ce06 06/25: Allow exemption from flood penalty in erc-backend, F. Jason Park, 2022/06/30
- master ecafe1cbb5 10/25: Recognize ASCII and strict CASEMAPPINGs in ERC, F. Jason Park, 2022/06/30
- master 752e860db4 16/25: Address long-standing ERC buffer-naming issues, F. Jason Park, 2022/06/30
- master 85c2f3bc3e 25/25: Update ERC's Info doc with network-ID related changes, F. Jason Park, 2022/06/30
- master 54414ec846 02/25: Initialize erc-server-filter-data in erc-backend, F. Jason Park, 2022/06/30
- master 4e312c07f7 11/25: Make ERC respect spaces in server passwords, F. Jason Park, 2022/06/30
- master 485b84cb7c 08/25: Require erc-networks in erc.el,
F. Jason Park <=
- master c356f86b51 09/25: Update ISUPPORT handling in ERC, F. Jason Park, 2022/06/30
- master 1c24af0fcb 12/25: Add helper to determine local channels in ERC, F. Jason Park, 2022/06/30
- master 529e46f128 13/25: Add eventual replacement for erc-default-recipients, F. Jason Park, 2022/06/30
- master 1767b0bd7e 19/25: Don't call erc-auto-query twice on PRIVMSG, F. Jason Park, 2022/06/30
- master 7c47d6c52d 18/25: Register erc-kill-buffer-function locally, F. Jason Park, 2022/06/30
- master 10237840d0 24/25: Optionally prevent sending multiline input in ERC, F. Jason Park, 2022/06/30
- master 9be08ceb31 15/25: Add ERC test server and related resources, F. Jason Park, 2022/06/30
- master 922ad23840 17/25: Add user-oriented test scenarios for ERC, F. Jason Park, 2022/06/30
- master e958a2b726 14/25: Discourage ill-defined use of buffer targets in ERC, F. Jason Park, 2022/06/30
- master 959fbcf34b 20/25: Favor network identities in erc-join, F. Jason Park, 2022/06/30