>From 0d6a8a2a0751b0a4831fdbaf9fecb2e92c676d45 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 15 Mar 2023 06:37:43 -0700 Subject: [PATCH 0/7] *** NOT A PATCH *** v8. Don't touch `standard-value'. Maintain sorted default value instead and add test to verify. F. Jason Park (7): [5.6] Honor arbitrary CHANTYPES in ERC [5.6] Copy over upstream Compat macros to erc-compat [5.6] Leverage loaddefs for migrating ERC modules [5.6] Don't require erc-goodies in erc.el [5.6] Modify erc-mode-map in module definitions [5.6] Add missing colors to erc-irccontrols-mode [5.6] Convert ERC's Imenu integration into proper module lisp/erc/erc-backend.el | 2 +- lisp/erc/erc-button.el | 6 +- lisp/erc/erc-common.el | 39 +---- lisp/erc/erc-compat.el | 52 +++++- lisp/erc/erc-goodies.el | 117 ++++++++----- lisp/erc/erc-ibuffer.el | 1 + lisp/erc/erc-imenu.el | 23 ++- lisp/erc/erc-log.el | 8 +- lisp/erc/erc-match.el | 8 +- lisp/erc/erc-page.el | 4 + lisp/erc/erc-pcomplete.el | 2 + lisp/erc/erc-services.el | 1 + lisp/erc/erc-sound.el | 1 + lisp/erc/erc-speedbar.el | 1 + lisp/erc/erc-stamp.el | 4 + lisp/erc/erc.el | 110 +++++++++---- test/lisp/erc/erc-goodies-tests.el | 253 +++++++++++++++++++++++++++++ test/lisp/erc/erc-tests.el | 195 ++++++++++++++++++++-- 18 files changed, 683 insertions(+), 144 deletions(-) create mode 100644 test/lisp/erc/erc-goodies-tests.el Interdiff: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e122f32d96a..34393189039 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1832,9 +1832,9 @@ erc-migrate-modules ;; each item is in the format '(old . new) (delete-dups (mapcar #'erc--normalize-module-symbol mods))) -(defcustom erc-modules '(netsplit fill button match track completion readonly - networks ring autojoin noncommands irccontrols - move-to-prompt stamp menu list imenu) +(defcustom erc-modules '( autojoin button completion fill imenu irccontrols + list match menu move-to-prompt netsplit + networks noncommands readonly ring stamp track) "A list of modules which ERC should enable. If you set the value of this without using `customize' remember to call \(erc-update-modules) after you change it. When using `customize', modules @@ -1850,9 +1850,7 @@ erc-modules (when-let* (((eq (car entry) 'const)) (s (cadddr entry))) ; (const :tag "..." ,s) (put s 'erc--module s))) - (custom-initialize-reset symbol exp) - (put symbol 'standard-value - (list (custom-quote (default-toplevel-value symbol))))) + (custom-initialize-reset symbol exp)) :set (lambda (sym val) ;; disable modules which have just been removed (when (and (boundp 'erc-modules) erc-modules val) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 3e844f45f1a..acd470a1e17 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -1275,6 +1275,14 @@ erc-tests--modules replace ring sasl scrolltobottom services smiley sound spelling stamp track truncate unmorse xdcc)) +;; Ensure that `:initialize' doesn't change the ordering of the +;; members because otherwise the widget's state is "edited". + +(ert-deftest erc-modules--initialize () + ;; This is `custom--standard-value' from Emacs 28. + (should (equal (eval (car (get 'erc-modules 'standard-value)) t) + erc-modules))) + ;; Ensure the `:initialize' function for `erc-modules' successfully ;; tags all built-in modules with the internal property `erc--module'. -- 2.39.2