summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2025-09-21 15:52:16 -0700
committerF. Jason Park <jp@neverwas.me>2026-05-12 21:03:02 -0700
commit1613f2e65263f01339be4107271d4abcee79edc5 (patch)
treef85c75690243a76b029a51355e79041f674d7bf8
parent76f5181bc6af50dd7eab6deb75d83fd8e83e50e4 (diff)
Preserve order of local ERC modules for activation
* etc/ERC-NEWS: Add new section for ERC 5.7. * lisp/erc/erc.el (erc--update-modules): Reverse returned list. * test/lisp/erc/erc-tests.el (erc--update-modules/local): Update.
-rw-r--r--etc/ERC-NEWS14
-rw-r--r--lisp/erc/erc.el2
-rw-r--r--test/lisp/erc/erc-tests.el2
3 files changed, 16 insertions, 2 deletions
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS
index 082c10702f3..de27b8f07e7 100644
--- a/etc/ERC-NEWS
+++ b/etc/ERC-NEWS
@@ -12,6 +12,20 @@ extensible IRC (Internet Relay Chat) client distributed with
GNU Emacs since Emacs version 22.1.
+* Changes in ERC 5.7
+
+** Changes in the library API.
+
+*** Local modules activate in preferred order instead of in reverse.
+In recent versions, ERC has enabled local modules in the reverse order
+of that produced by the "set" function used by 'setopt' and the Custom
+UI for the option 'erc-modules'. Specifically, Built-in locals were
+activated in reverse lexicographic order after third-party ones, which
+were simply reversed as given. Now, just like with global modules, ERC
+preserves the preferred order when activating local modules for new
+sessions.
+
+
* Changes in ERC 5.6.2
** Option 'erc-log-insert-log-on-open' can be a function.
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index d14d85913b3..755b00f375c 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2467,7 +2467,7 @@ invocations by third-party packages.")
(defun erc--update-modules (modules)
(let (local-modes)
- (dolist (module modules local-modes)
+ (dolist (module modules (nreverse local-modes))
(if-let* ((mode (erc--find-mode module)))
(if (custom-variable-p mode)
(funcall mode 1)
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 35997a83de1..f2f874717e9 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -3990,7 +3990,7 @@ keyword :result."
;; Returns local modules.
(should (equal (mapcar #'symbol-name (erc--update-modules erc-modules))
- '("erc-lo2-mode" "erc-lo1-mode")))
+ '("erc-lo1-mode" "erc-lo2-mode")))
;; Requiring `erc-lo2' defines `erc-lo2-mode'.
(should (equal (mapcar #'prin1-to-string (funcall get-calls))