erc-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Erc-discuss] buffer local erc-hide-list ?


From: Giorgos Keramidas
Subject: Re: [Erc-discuss] buffer local erc-hide-list ?
Date: Wed, 23 Nov 2011 13:07:07 +0100

On Sun, Nov 20, 2011 at 5:08 PM, Peter Baranyi <address@hidden> wrote:
> Hi,
>
> I'd like to use different erc-hide-list values for different channels.
> If I'm on a public channel like #debian or #emacs, I don't want to see
> any join/part/quit messages, while on a private channel with 2-3 people
> it's good to see when someone leaves/joins.
>
> I tried to (make-variable-buffer-local 'erc-hide-list), but it does not
> work, erc uses the global value.
>
> How can I accomplish this?

It probably requires modifying (erc-display-message) in erc.el.  The
current function checks erc-hide-list but without making the target
buffer the currently active buffer, so the buffer-local value of
erc-hide-list is not taken into account:

,-----------------------------------------------------------------------
| (defun erc-display-message (parsed type buffer msg &rest args)
|   "Display MSG in BUFFER.
|
| ARGS, PARSED, and TYPE are used to format MSG sensibly.
|
| See also ‘erc-format-message’ and ‘erc-display-line’."
|   (let ((string (if (symbolp msg)
|                     (apply ’erc-format-message msg args)
|                   msg)))
|     (setq string
|           (cond
|            ((null type)
|             string)
|            ((listp type)
|             (mapc (lambda (type)
|                     (setq string
|                           (erc-display-message-highlight type string)))
|                   type)
|             string)
|            ((symbolp type)
|             (erc-display-message-highlight type string))))
|
|     (if (not (erc-response-p parsed))
|         (erc-display-line string buffer)
| -       (unless (member (erc-response.command parsed) erc-hide-list)
| +       (unless (member (erc-response.command parsed)
| +                       (with-current-buffer buffer
| +                         erc-hide-list))
|       (unless (member (erc-response.command parsed)
|                       (with-current-buffer buffer
|                         erc-hide-list))
|         (erc-put-text-property 0 (length string) ’erc-parsed parsed string)
|         (erc-put-text-property 0 (length string) ’rear-sticky t string)
|         (erc-display-line string buffer)))))
`-----------------------------------------------------------------------

Without this change the global erc-hide-list is checked, with the effect
that you just described.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]