;;; erc-match.el --- Highlight messages matching certain regexps
-;; Copyright (C) 2002,2003,2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002,2003,2004 Free Software Foundation, Inc.
;; Copyright (C) 2004 Jeremy Bertram Maitin-Shepard
;; Author: Andreas Fuchs <firstname.lastname@example.org>
"*Determines how to highlight text in which your current nickname appears
\(does not apply to text sent by you\).
+(defcustom erc-beep-match-types '(current-nick)
+ "Types of matches to beep for when a match occurs.
+The function `erc-beep-on-match' needs to be added to `erc-text-matched-hook'
+ :type '(choice (repeat :tag "Beep on match" (choice
+ (const :tag "Don't beep" nil)))
(defcustom erc-text-matched-hook '(erc-log-matches)
"Hook run when text matches a given match-type.
Functions in this hook are passed as arguments:
\(match-type nick!user@host message) where MATCH-TYPE is a symbol of:
-keyword, pal, dangerous-host, fool"
- :options '(erc-log-matches erc-hide-fools)
+current-nick, keyword, pal, dangerous-host, fool"
+ :options '(erc-log-matches erc-hide-fools erc-beep-on-match)
+(defun erc-beep-on-match (match-type nickuserhost message)
+ "Beep when text matches.
+This function is meant to be called from `erc-text-matched-hook'."
+ (when (member match-type erc-beep-match-types)
;;; erc-match.el ends here