[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 90a9c7b7b59 05/14: Actually define erc-default-server-functions
From: |
F. Jason Park |
Subject: |
master 90a9c7b7b59 05/14: Actually define erc-default-server-functions |
Date: |
Fri, 5 May 2023 20:30:47 -0400 (EDT) |
branch: master
commit 90a9c7b7b594dfcdc985541eb366e5684136c3ec
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Actually define erc-default-server-functions
* lisp/erc/erc-backend.el: Remove top-level `add-hook' for
`erc-default-server-functions'.
* lisp/erc/erc.el (erc-default-server-hook,
erc-default-server-functions): Officially deprecate the former and
rename it to the latter.
(erc-default-server-handler): Mark obsolete because its replacement
took over years ago.
(erc-debug-missing-hooks): Append instead of mutate.
---
lisp/erc/erc-backend.el | 2 --
lisp/erc/erc.el | 16 ++++++++++++----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index d14640e798d..0c970a9d586 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1459,8 +1459,6 @@ Finds hooks by looking in the `erc-server-responses' hash
table."
(erc-with-server-buffer
(run-hook-with-args 'erc-timer-hook (erc-current-time)))))
-(add-hook 'erc-default-server-functions #'erc-handle-unknown-server-response)
-
(defun erc-handle-unknown-server-response (proc parsed)
"Display unknown server response's message."
(let ((line (concat (erc-response.sender parsed)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index fec1e1a4eb9..05b6b5bfd21 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -4689,9 +4689,13 @@ This places `point' just after the prompt, or at the
beginning of the line."
; Stolen from ZenIRC. I just wanna test this code, so here is
; experiment area.
-(defcustom erc-default-server-hook '(erc-debug-missing-hooks
- erc-default-server-handler)
- "Default for server messages which aren't covered by `erc-server-hooks'."
+;; This shouldn't be a user option but remains so for compatibility.
+(define-obsolete-variable-alias
+ 'erc-default-server-hook 'erc-default-server-functions "30.1")
+(defcustom erc-default-server-functions '(erc-handle-unknown-server-response)
+ "Abnormal hook for incoming messages without their own handlers.
+See `define-erc-response-handler' for more."
+ :package-version '(ERC . "5.6")
:group 'erc-server-hooks
:type 'hook)
@@ -4699,6 +4703,7 @@ This places `point' just after the prompt, or at the
beginning of the line."
"Default server handler.
Displays PROC and PARSED appropriately using `erc-display-message'."
+ (declare (obsolete erc-handle-unknown-server-response "29.1"))
(erc-display-message
parsed 'notice proc
(mapconcat
@@ -4721,7 +4726,7 @@ See `erc-debug-missing-hooks'.")
"Add PARSED server message ERC does not yet handle to `erc-server-vectors'.
These vectors can be helpful when adding new server message handlers to ERC.
See `erc-default-server-hook'."
- (nconc erc-server-vectors (list parsed))
+ (setq erc-server-vectors `(,@erc-server-vectors ,parsed))
nil)
(defun erc--open-target (target)
@@ -4915,6 +4920,9 @@ See also `erc-display-error-notice'."
;;; Server messages
+;; FIXME remove on next major version release. This group is all but
+;; unused because most `erc-server-FOO-functions' are plain variables
+;; and not user options as implied by this doc string.
(defgroup erc-server-hooks nil
"Server event callbacks.
Every server event - like numeric replies - has its own hook.
- master updated (1ef219e220c -> ba44b481844), F. Jason Park, 2023/05/05
- master c9f1ad2a870 01/14: Revive option erc-query-on-unjoined-chan-privmsg, F. Jason Park, 2023/05/05
- master 8654cea5843 02/14: Move ERC's buffer-display tests to separate file, F. Jason Park, 2023/05/05
- master 5de90fa9611 03/14: Extend erc-interactive-display to cover /JOINs, F. Jason Park, 2023/05/05
- master 9e1a5a389ed 04/14: Ignore erc-reconnect-display after a timeout, F. Jason Park, 2023/05/05
- master 90a9c7b7b59 05/14: Actually define erc-default-server-functions,
F. Jason Park <=
- master b0d761be0f9 08/14: Restore module var toggles in ERC's Custom buffers, F. Jason Park, 2023/05/05
- master 2e18ba6302f 07/14: Simplify erc-button movement commands, F. Jason Park, 2023/05/05
- master 2641dfd4b43 06/14: Add erc-timestamp property to invisible messages, F. Jason Park, 2023/05/05
- master 16306567706 09/14: Don't send multiline commands as messages in ERC, F. Jason Park, 2023/05/05
- master 35dd1ade7f1 11/14: Preprocess prompt input linewise in ERC, F. Jason Park, 2023/05/05
- master ba44b481844 14/14: Add interface for finding users in erc-server-PRIVMSG, F. Jason Park, 2023/05/05
- master 3a5a6fce957 10/14: Redo line splitting for outgoing messages in ERC, F. Jason Park, 2023/05/05
- master 5adda2f4683 12/14: Revise FORM-as-function interface in erc-button-alist, F. Jason Park, 2023/05/05
- master d141f7149b6 13/14: Improve erc-button--modify-nick-function interface, F. Jason Park, 2023/05/05