diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-24 09:29:08 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-24 09:29:08 -0400 |
| commit | ff41be114a8b55e8602c3c33e96eeb5e9905b72e (patch) | |
| tree | 77ea1cd48a18eb3e43541d870820c090903b8fce /modules/erc-config.el | |
| parent | 05ae7757260e70df73e74c3867b843fe103946f8 (diff) | |
| download | dotemacs-ff41be114a8b55e8602c3c33e96eeb5e9905b72e.tar.gz dotemacs-ff41be114a8b55e8602c3c33e96eeb5e9905b72e.zip | |
chore(elisp): clear byte-compile warnings (mail, dashboard, eshell, erc)
Add declare-function/defvar declarations for lazily-loaded package functions and variables so each module compiles cleanly standalone, reflow over-long docstrings, and swap the obsolete erc-server-buffer-p for its named replacement erc-server-or-unjoined-channel-buffer-p (obsolete since 30.1). No behavior change. Two erc setq targets (erc-unique-buffers, erc-generate-buffer-name-function) appear not to be real ERC variables — declared to silence the warning with a NOTE flagging that the intended buffer-naming may not be taking effect.
Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ
Diffstat (limited to 'modules/erc-config.el')
| -rw-r--r-- | modules/erc-config.el | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/modules/erc-config.el b/modules/erc-config.el index c89e46bb3..3e98a66a3 100644 --- a/modules/erc-config.el +++ b/modules/erc-config.el @@ -33,6 +33,33 @@ ;; is read at load time below (erc-user-full-name), so a standalone .elc needs it. (require 'user-constants) +;; ERC loads lazily (use-package :commands), so these symbols aren't bound at +;; this file's compile time. Declare them to keep the byte-compiler quiet +;; without forcing an eager require. + +;; Functions provided by the erc package. +(declare-function erc-buffer-list "erc") +(declare-function erc-server-process-alive "erc") +(declare-function erc-server-or-unjoined-channel-buffer-p "erc") +(declare-function erc-current-nick "erc") +(declare-function erc-join-channel "erc") +(declare-function erc-part-from-channel "erc") +(declare-function erc-quit-server "erc") + +;; Variables read/set in the use-package :config block below. +(defvar erc-log-channels-directory) +(defvar erc-track-exclude-types) +(defvar erc-track-exclude-server-buffer) +(defvar erc-track-visibility) +(defvar erc-track-switch-direction) +(defvar erc-track-showcount) +;; NOTE: erc-unique-buffers and erc-generate-buffer-name-function are not ERC +;; variables in Emacs 30.x (no defcustom/defvar in the package); the setq below +;; only creates inert globals. Declared here to silence the warning without +;; changing the existing (no-op) behavior -- see the SUSPICIOUS note. +(defvar erc-unique-buffers) +(defvar erc-generate-buffer-name-function) + ;; ------------------------------------ ERC ------------------------------------ ;; Server definitions and connection settings @@ -99,7 +126,7 @@ Change this value to use a different nickname.") (let ((server-buffers '())) (dolist (buf (erc-buffer-list)) (with-current-buffer buf - (when (and (erc-server-buffer-p) (erc-server-process-alive)) + (when (and (erc-server-or-unjoined-channel-buffer-p) (erc-server-process-alive)) (unless (member (buffer-name) server-buffers) (push (buffer-name) server-buffers))))) @@ -132,7 +159,7 @@ Buffer names are shown with server context for clarity." "Return t if the current buffer is an active ERC server buffer." (and (derived-mode-p 'erc-mode) (erc-server-process-alive) - (erc-server-buffer-p))) + (erc-server-or-unjoined-channel-buffer-p))) (defun cj/erc-get-channels-for-current-server () @@ -158,7 +185,7 @@ Auto-adds # prefix if missing. Offers completion from configured channels." (let ((server-buffers (cl-remove-if-not (lambda (buf) (with-current-buffer buf - (and (erc-server-buffer-p) + (and (erc-server-or-unjoined-channel-buffer-p) (erc-server-process-alive)))) (erc-buffer-list)))) (if server-buffers |
