[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c1befaf0a8b 10/19: Skip erc-ignored-user-p when erc-ignore-list i
From: |
F. Jason Park |
Subject: |
master c1befaf0a8b 10/19: Skip erc-ignored-user-p when erc-ignore-list is empty |
Date: |
Sun, 17 Dec 2023 23:21:39 -0500 (EST) |
branch: master
commit c1befaf0a8b19fdd3b22e824f4bfc10f8882db67
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Skip erc-ignored-user-p when erc-ignore-list is empty
* lisp/erc/erc-backend.el (erc-server-PRIVMSG): Don't bother running
`erc-ignored-user-p' and `erc-ignored-reply-p' when their associated
options are null. The option `erc-ignore-list' is buffer-local when
set, and `erc-ignored-user-p' looks for it in the server buffer.
Moreover, all functions that set it, like `erc-cmd-IGNORE' and
`erc-cmd-UNIGNORE', do so in the server buffer. And the response
handler in question only runs in server buffers, so this shouldn't
break anything. Also, remove stray call to reassign trailing response
contents.
* lisp/erc/erc-common.el (erc-get-server-user): Rearrange so
`erc-with-server-buffer' doesn't have to switch to the server buffer
because `erc-downcase' can run in channels as well.
* lisp/erc/erc.el (erc-ignored-user-p): Add comment. (Bug#67677)
---
lisp/erc/erc-backend.el | 7 ++++---
lisp/erc/erc-common.el | 5 +++--
lisp/erc/erc.el | 2 ++
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 6483192692b..1c29f49a129 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1913,8 +1913,10 @@ add things to `%s' instead."
(tgt (car (erc-response.command-args parsed)))
(msg (erc-response.contents parsed)))
(defvar erc-minibuffer-ignored)
- (if (or (erc-ignored-user-p sender-spec)
- (erc-ignored-reply-p msg tgt proc))
+ (defvar erc-ignore-list)
+ (defvar erc-ignore-reply-list)
+ (if (or (and erc-ignore-list (erc-ignored-user-p sender-spec))
+ (and erc-ignore-reply-list (erc-ignored-reply-p msg tgt proc)))
(when erc-minibuffer-ignored
(message "Ignored %s from %s to %s" cmd sender-spec tgt))
(let* ((sndr (erc-parse-user sender-spec))
@@ -1929,7 +1931,6 @@ add things to `%s' instead."
,@erc--display-context))
s buffer
fnick)
- (setf (erc-response.contents parsed) msg)
(setq buffer (erc-get-buffer (if privp nick tgt) proc))
;; Even worth checking for empty target here? (invalid anyway)
(unless (or buffer noticep (string-empty-p tgt) (eq ?$ (aref tgt 0))
diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el
index ce0831709c7..90112ab9126 100644
--- a/lisp/erc/erc-common.el
+++ b/lisp/erc/erc-common.el
@@ -498,8 +498,9 @@ Use the CASEMAPPING ISUPPORT parameter to determine the
style."
(define-inline erc-get-server-user (nick)
"Find NICK in the current server's `erc-server-users' hash table."
(inline-letevals (nick)
- (inline-quote (erc-with-server-buffer
- (gethash (erc-downcase ,nick) erc-server-users)))))
+ (inline-quote
+ (gethash (erc-downcase ,nick)
+ (erc-with-server-buffer erc-server-users)))))
(defmacro erc--with-dependent-type-match (type &rest features)
"Massage Custom :type TYPE with :match function that pre-loads FEATURES."
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 2e078651a52..dad7ebab621 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -7718,6 +7718,8 @@ The previous default target of QUERY type gets removed."
(setq erc-default-recipients d2)
(error "Current target is not a QUERY"))))
+;; FIXME move all ignore-related functionality to its own module,
+;; required and enabled by default (until some major version change).
(defun erc-ignored-user-p (spec)
"Return non-nil if SPEC matches something in `erc-ignore-list'.
- master 1e2b156f040 04/19: Double hyphenate internal ERC 5.6 text props, (continued)
- master 1e2b156f040 04/19: Double hyphenate internal ERC 5.6 text props, F. Jason Park, 2023/12/17
- master b5da8ba8070 02/19: Define ERC message-formatting templates with defvar, F. Jason Park, 2023/12/17
- master 69ca2cc1138 05/19: Add utility for iterating over arrays in ERC, F. Jason Park, 2023/12/17
- master 4ee4865ce20 07/19: Add erc-server-396 response handler, F. Jason Park, 2023/12/17
- master 741bce84890 16/19: Forgo excess nick buttonizing on JOINs and QUITs, F. Jason Park, 2023/12/17
- master 7c2e02e6d79 01/19: Remove module from suggested lineup in ERC's manual, F. Jason Park, 2023/12/17
- master 11bae96d23b 08/19: Clarify warning for process-dependent input in ERC, F. Jason Park, 2023/12/17
- master 6e4417eaa7e 14/19: Consolidate status-prefix slots of erc-channel-user, F. Jason Park, 2023/12/17
- master 7db500b50be 09/19: Make erc-get-user-mode-prefix more flexible, F. Jason Park, 2023/12/17
- master 9d961b31070 13/19: Demote erc-fill-line-spacing to a normal variable, F. Jason Park, 2023/12/17
- master c1befaf0a8b 10/19: Skip erc-ignored-user-p when erc-ignore-list is empty,
F. Jason Park <=
- master 236a416be76 11/19: Add erc--spkr text property to chat messages, F. Jason Park, 2023/12/17
- master 951b115c2ac 06/19: Make erc-input's refoldp slot conditionally available, F. Jason Park, 2023/12/17
- master 08ec3e89793 15/19: Rename erc-channel-users to erc-channel-members, F. Jason Park, 2023/12/17
- master 8e06f224a9e 19/19: Add erc-track integration to erc-nicks, F. Jason Park, 2023/12/17
- master 9d889af0d68 17/19: Promote "normal" faces in erc-track, F. Jason Park, 2023/12/17