From 248355587012368e225d727770691cab21760e7c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 6 Aug 2012 02:15:34 +0200 Subject: [PATCH] erc-match: add option to exclude server buffer * erc-match.el (erc-match-exclude-server-buffer) (erc-match-message): Add new option to exclude server buffer from matching. --- lisp/erc/ChangeLog | 6 ++++++ lisp/erc/erc-match.el | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37758048258..b87cfd41f61 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,9 @@ +2012-08-06 Julien Danjou + + * erc-match.el (erc-match-exclude-server-buffer) + (erc-match-message): Add new option to exclude server buffer from + matching. + 2012-07-21 Julien Danjou * erc-notifications.el: New file. diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 9fbe9544677..259eb201fe0 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -232,6 +232,14 @@ current-nick, keyword, pal, dangerous-host, fool" :group 'erc-match :type 'hook) +(defcustom erc-match-exclude-server-buffer nil + "If true, don't perform match on the server buffer; this is +useful for excluding all the things like MOTDs from the server +and other miscellaneous functions." + :group 'erc-match + :version "24.2" + :type 'boolean) + ;; Internal variables: ;; This is exactly the same as erc-button-syntax-table. Should we @@ -449,7 +457,9 @@ Use this defun with `erc-insert-modify-hook'." (+ 2 nick-end) (point-min)) (point-max)))) - (when vector + (when (and vector + (not (and erc-track-exclude-server-buffer + (erc-server-buffer-p)))) (mapc (lambda (match-type) (goto-char (point-min)) -- 2.39.2