[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Draft patch: Supporting buffer-local `erc-hide-*'
From: |
Alcor |
Subject: |
Draft patch: Supporting buffer-local `erc-hide-*' |
Date: |
Fri, 22 Nov 2024 19:22:12 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Erc'ers,
I've tried modifying Erc to support buffer-local erc-hide-*
variables. The idea is to support message type filtering per channel
buffer, which is useful for "noisy" channels.
Attached is a patch with an implementation idea, which I have tested out
for a couple of hours. The approach is as follows:
1. Extract out a function `erc-buffer-expand' (perhaps a different name
might be better?) from `erc--route-insertion' that normalizes Erc's
buffer specification values to lists.
2. Add a helper `erc-hide-current-message-in-buffer-p' that evaluates
`erc-hide-current-message-p' in a (with-current-buffer ...) context.
3. Modify `erc-display-message' to use #1 & #2, ensuring only non-hidden
messages as per the predicate from #2 get inserted.
Feedback welcome. I'm still a bit dissatisfied with some aspects of the
patch and am left wondering if there's a way to avoid adding an extra
argument to `erc--route-insertion'. Testing on a number of IRC channels
with (setq-local erc-hide-list '("PART" "JOIN" "QUIT")) while comparing
with the defaults yields good results however, with all specified
messages being correctly filtered out.
Cheers,
-A.
PS: Regarding the terminology - "erc-hide-*" feels slightly
misleading. I'm not familiar with Erc's internals but I have not found a
way to "unhide" messages, so this feature (as it is) is more of
"discard" or "drop" compared to the similarly-named functionality in
Circe, which is reversible.
0001-Support-buffer-local-erc-hide-list-erc-channel-hide-.patch
Description: Text Data
- Draft patch: Supporting buffer-local `erc-hide-*',
Alcor <=