diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-14 15:43:36 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-14 15:43:36 -0500 |
| commit | 92c062b8b4cc70b09d5487d1cc29287ad52babdf (patch) | |
| tree | 418d0b261f85c7183ae925cc171ae13ba1322282 /modules | |
| parent | 808607872702075e638e5813f3c2958c100cdb6c (diff) | |
| download | dotemacs-92c062b8b4cc70b09d5487d1cc29287ad52babdf.tar.gz dotemacs-92c062b8b4cc70b09d5487d1cc29287ad52babdf.zip | |
fix(erc): one mention notification, real server list, runtime require
Three audit defects. erc-modules carried the built-in notifications module while :config also added cj/erc-notify-on-mention to the same erc-text-matched-hook, so every mention popped two desktop notifications. Dropped notifications from erc-modules and kept the custom one. cj/erc-connected-servers compared a buffer's erc-server-process to itself inside with-current-buffer (always true), so it returned every ERC buffer; it now filters on erc-server-buffer-p and erc-server-process-alive. And user-constants moved from an eval-when-compile-only require to a runtime require, since user-whole-name is read at load time for erc-user-full-name.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/erc-config.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/erc-config.el b/modules/erc-config.el index 22ba7f53d..067b1e577 100644 --- a/modules/erc-config.el +++ b/modules/erc-config.el @@ -28,8 +28,10 @@ ;; Load cl-lib at compile time and runtime (lightweight, already loaded in most configs) (require 'cl-lib) (require 'keybindings) ;; provides cj/custom-keymap -(eval-when-compile (require 'erc) - (require 'user-constants)) +(eval-when-compile (require 'erc)) +;; user-constants is required at runtime, not just compile time: `user-whole-name' +;; is read at load time below (erc-user-full-name), so a standalone .elc needs it. +(require 'user-constants) ;; ------------------------------------ ERC ------------------------------------ ;; Server definitions and connection settings @@ -97,7 +99,7 @@ Change this value to use a different nickname.") (let ((server-buffers '())) (dolist (buf (erc-buffer-list)) (with-current-buffer buf - (when (eq (buffer-local-value 'erc-server-process buf) erc-server-process) + (when (and (erc-server-buffer-p) (erc-server-process-alive)) (unless (member (buffer-name) server-buffers) (push (buffer-name) server-buffers))))) @@ -222,7 +224,6 @@ Auto-adds # prefix if missing. Offers completion from configured channels." match move-to-prompt noncommands - notifications readonly services stamp |
