aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorF. Jason Park2024-01-29 19:04:58 -0800
committerF. Jason Park2024-02-02 17:03:43 -0800
commitbb894845ed6a06e8b301251d62f8b4a73a09d5ea (patch)
tree769f9643f2e6139b76a5aa99093459ef399b6fe7
parent82e50a23fea8bc435bfae8390008702aa7d74bda (diff)
downloademacs-bb894845ed6a06e8b301251d62f8b4a73a09d5ea.tar.gz
emacs-bb894845ed6a06e8b301251d62f8b4a73a09d5ea.zip
Teach customize-option about erc-modules
* lisp/erc/erc-goodies.el (erc-scrolltobottom-mode) (erc-scrolltobottom-enable): Use `setq' instead of `setopt' because the latter isn't defined in Emacs 27 and 28. This fix is unrelated to the main thrust of this commit. * lisp/erc/erc.el (erc-modules): Make good on decades old language in info node "(erc) Modules" by ensuring `customize-option' can find this option before its containing library is loaded. Like `gnus-select-method', this option serves as an entry point for configuring the application and is presented that way in tutorials and library front matter. Moreover, it can't be reasonably autoloaded in the traditional way because of its many dependencies and large textual footprint. (erc-display-message): Revise doc string.
-rw-r--r--lisp/erc/erc-goodies.el2
-rw-r--r--lisp/erc/erc.el37
2 files changed, 21 insertions, 18 deletions
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 8293994c5d4..7e30b1060fd 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -83,7 +83,7 @@ be experimental. It currently only works with Emacs 28+."
83 (when (and erc-scrolltobottom-all (< emacs-major-version 28)) 83 (when (and erc-scrolltobottom-all (< emacs-major-version 28))
84 (erc-button--display-error-notice-with-keys 84 (erc-button--display-error-notice-with-keys
85 "Option `erc-scrolltobottom-all' requires Emacs 28+. Disabling.") 85 "Option `erc-scrolltobottom-all' requires Emacs 28+. Disabling.")
86 (setopt erc-scrolltobottom-all nil)) 86 (setq erc-scrolltobottom-all nil))
87 (unless erc--updating-modules-p (erc-buffer-do #'erc--scrolltobottom-setup)) 87 (unless erc--updating-modules-p (erc-buffer-do #'erc--scrolltobottom-setup))
88 (if erc-scrolltobottom-all 88 (if erc-scrolltobottom-all
89 (progn 89 (progn
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index edac1060c3e..67c31d961e3 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2183,13 +2183,17 @@ buffer rather than a server buffer.")
2183 (cl-pushnew mod (if (get mod 'erc--module) built-in third-party))) 2183 (cl-pushnew mod (if (get mod 'erc--module) built-in third-party)))
2184 `(,@(sort built-in #'string-lessp) ,@(nreverse third-party)))) 2184 `(,@(sort built-in #'string-lessp) ,@(nreverse third-party))))
2185 2185
2186;;;###autoload(custom-autoload 'erc-modules "erc")
2187
2186(defcustom erc-modules '( autojoin button completion fill imenu irccontrols 2188(defcustom erc-modules '( autojoin button completion fill imenu irccontrols
2187 list match menu move-to-prompt netsplit 2189 list match menu move-to-prompt netsplit
2188 networks readonly ring stamp track) 2190 networks readonly ring stamp track)
2189 "A list of modules which ERC should enable. 2191 "Modules to enable while connecting.
2190If you set the value of this without using `customize' remember to call 2192When modifying this option in lisp code, use a Custom-friendly
2191\(erc-update-modules) after you change it. When using `customize', modules 2193facilitator, like `setopt', or call `erc-update-modules'
2192removed from the list will be disabled." 2194afterward. This ensures a consistent ordering and disables
2195removed modules. It also gives packages access to the hook
2196`erc-before-connect'."
2193 :get (lambda (sym) 2197 :get (lambda (sym)
2194 ;; replace outdated names with their newer equivalents 2198 ;; replace outdated names with their newer equivalents
2195 (erc-migrate-modules (symbol-value sym))) 2199 (erc-migrate-modules (symbol-value sym)))
@@ -3828,14 +3832,14 @@ TYPE, when non-nil, to be a symbol handled by
3828string MSG). Expect BUFFER to be among the sort accepted by the 3832string MSG). Expect BUFFER to be among the sort accepted by the
3829function `erc-display-line'. 3833function `erc-display-line'.
3830 3834
3831Expect BUFFER to be a live `erc-mode' buffer, a list of such 3835When non-nil, expect BUFFER to be a live `erc-mode' buffer, a
3832buffers, or the symbols `all' or `active'. If `all', insert 3836list of such buffers, or the symbols `all' or `active'. If
3833STRING in all buffers for the current session. If `active', 3837`all', insert STRING in all buffers for the current session. If
3834defer to the function `erc-active-buffer', which may return the 3838`active', defer to the function `erc-active-buffer', which may
3835session's server buffer if the previously active buffer has been 3839return the session's server buffer if the previously active
3836killed. If BUFFER is nil or a network process, pretend it's set 3840buffer has been killed. If BUFFER is nil or a network process,
3837to the appropriate server buffer. Otherwise, use the current 3841pretend it's set to the appropriate server buffer. Otherwise,
3838buffer. 3842use the current buffer.
3839 3843
3840When TYPE is a list of symbols, call handlers from left to right 3844When TYPE is a list of symbols, call handlers from left to right
3841without influencing how they behave when encountering existing 3845without influencing how they behave when encountering existing
@@ -3848,11 +3852,10 @@ being (erc-error-face erc-notice-face) throughout MSG when
3848`erc-notice-highlight-type' is left at its default, `all'. 3852`erc-notice-highlight-type' is left at its default, `all'.
3849 3853
3850As of ERC 5.6, assume third-party code will use this function 3854As of ERC 5.6, assume third-party code will use this function
3851instead of lower-level ones, like `erc-insert-line', when needing 3855instead of lower-level ones, like `erc-insert-line', to insert
3852ERC to process arbitrary informative messages as if they'd been 3856arbitrary informative messages as if sent by the server. That
3853sent from a server. That is, guarantee \"local\" messages, for 3857is, tell modules to treat a \"local\" message for which PARSED is
3854which PARSED is typically nil, will be subject to buttonizing, 3858nil like any other server-sent message."
3855filling, and other effects."
3856 (let* ((erc--msg-props 3859 (let* ((erc--msg-props
3857 (or erc--msg-props 3860 (or erc--msg-props
3858 (let ((table (make-hash-table)) 3861 (let ((table (make-hash-table))