]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-match.el
Fixes: debbugs:13316
[gnu-emacs] / lisp / erc / erc-match.el
index 24170caa1260dfa029f5fe9e02b8a86e5df6811a..8dcdcb9e2e6eb63e8fd1a262cef10a614b5deee2 100644 (file)
@@ -1,9 +1,9 @@
 ;;; erc-match.el --- Highlight messages matching certain regexps
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006,
-;;   2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
+;; Maintainer: FSF
 ;; Keywords: comm, faces
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcMatch
 
 ;; customizable variables.
 
 ;; Usage:
-;; Put (erc-match-mode 1) into your ~/.emacs file.
+;; Put (erc-match-mode 1) into your init file.
 
 ;;; Code:
 
 (require 'erc)
 (eval-when-compile (require 'cl))
 
-;; Customisation:
+;; Customization:
 
 (defgroup erc-match nil
   "Keyword and Friend/Foe/... recognition.
@@ -84,7 +84,7 @@ Useful to mark nicks from dangerous hosts."
   :type '(repeat regexp))
 
 (defcustom erc-current-nick-highlight-type 'keyword
-  "*Determines how to highlight text in which your current nickname appears
+  "Determines how to highlight text in which your current nickname appears
 \(does not apply to text sent by you\).
 
 The following values are allowed:
@@ -106,7 +106,7 @@ Any other value disables highlighting of current nickname altogether."
                 (const all)))
 
 (defcustom erc-pal-highlight-type 'nick
-  "*Determines how to highlight messages by pals.
+  "Determines how to highlight messages by pals.
 See `erc-pals'.
 
 The following values are allowed:
@@ -122,7 +122,7 @@ Any other value disables pal highlighting altogether."
                 (const all)))
 
 (defcustom erc-fool-highlight-type 'nick
-  "*Determines how to highlight messages by fools.
+  "Determines how to highlight messages by fools.
 See `erc-fools'.
 
 The following values are allowed:
@@ -138,7 +138,7 @@ Any other value disables fool highlighting altogether."
                 (const all)))
 
 (defcustom erc-keyword-highlight-type 'keyword
-  "*Determines how to highlight messages containing keywords.
+  "Determines how to highlight messages containing keywords.
 See variable `erc-keywords'.
 
 The following values are allowed:
@@ -153,7 +153,7 @@ Any other value disables keyword highlighting altogether."
                 (const all)))
 
 (defcustom erc-dangerous-host-highlight-type 'nick
-  "*Determines how to highlight messages by nicks from dangerous-hosts.
+  "Determines how to highlight messages by nicks from dangerous-hosts.
 See `erc-dangerous-hosts'.
 
 The following values are allowed:
@@ -233,6 +233,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.3"
+  :type 'boolean)
+
 ;; Internal variables:
 
 ;; This is exactly the same as erc-button-syntax-table.  Should we
@@ -259,26 +267,26 @@ constituents.")
 
 ;; Faces:
 
-(defface erc-current-nick-face '((t (:bold t :foreground "DarkTurquoise")))
+(defface erc-current-nick-face '((t :weight bold :foreground "DarkTurquoise"))
   "ERC face for occurrences of your current nickname."
   :group 'erc-faces)
 
-(defface erc-dangerous-host-face '((t (:foreground "red")))
+(defface erc-dangerous-host-face '((t :foreground "red"))
   "ERC face for people on dangerous hosts.
 See `erc-dangerous-hosts'."
   :group 'erc-faces)
 
-(defface erc-pal-face '((t (:bold t :foreground "Magenta")))
+(defface erc-pal-face '((t :weight bold :foreground "Magenta"))
   "ERC face for your pals.
 See `erc-pals'."
   :group 'erc-faces)
 
-(defface erc-fool-face '((t (:foreground "dim gray")))
+(defface erc-fool-face '((t :foreground "dim gray"))
   "ERC face for fools on the channel.
 See `erc-fools'."
   :group 'erc-faces)
 
-(defface erc-keyword-face '((t (:bold t :foreground "pale green")))
+(defface erc-keyword-face '((t :weight bold :foreground "pale green"))
   "ERC face for your keywords.
 Note that this is the default face to use if
 `erc-keywords' does not specify another."
@@ -450,7 +458,9 @@ Use this defun with `erc-insert-modify-hook'."
                                        (+ 2 nick-end)
                                      (point-min))
                                    (point-max))))
-    (when vector
+    (when (and vector
+              (not (and erc-match-exclude-server-buffer
+                        (erc-server-buffer-p))))
       (mapc
        (lambda (match-type)
         (goto-char (point-min))
@@ -634,5 +644,3 @@ This function is meant to be called from `erc-text-matched-hook'."
 ;; indent-tabs-mode: t
 ;; tab-width: 8
 ;; End:
-
-;; arch-tag: 1f1f595e-abcc-4b0b-83db-598a1d3f0f82