;;; erc-match.el --- Highlight messages matching certain regexps
-;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2016 Free Software Foundation, Inc.
;; Author: Andreas Fuchs <asf@void.at>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Keywords: comm, faces
;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcMatch
(defcustom erc-current-nick-highlight-type 'keyword
"Determines how to highlight text in which your current nickname appears
-\(does not apply to text sent by you\).
+\(does not apply to text sent by you).
The following values are allowed:
- nil - do not highlight the message at all
- 'keyword - highlight all instances of current nickname in message
- 'nick - highlight the nick of the user who typed your nickname
- 'nick-or-keyword - highlight the nick of the user who typed your nickname,
- or all instances of the current nickname if there was
- no sending user
- 'all - highlight the entire message where current nickname occurs
+ nil - do not highlight the message at all
+ `keyword' - highlight all instances of current nickname in message
+ `nick' - highlight the nick of the user who typed your nickname
+ `nick-or-keyword' - highlight the nick of the user who typed your nickname,
+ or all instances of the current nickname if there was
+ no sending user
+ `all' - highlight the entire message where current nickname occurs
Any other value disables highlighting of current nickname altogether."
:group 'erc-match
The following values are allowed:
- nil - do not highlight the message at all
- 'nick - highlight pal's nickname only
- 'all - highlight the entire message from pal
+ nil - do not highlight the message at all
+ `nick' - highlight pal's nickname only
+ `all' - highlight the entire message from pal
Any other value disables pal highlighting altogether."
:group 'erc-match
The following values are allowed:
- nil - do not highlight the message at all
- 'nick - highlight fool's nickname only
- 'all - highlight the entire message from fool
+ nil - do not highlight the message at all
+ `nick' - highlight fool's nickname only
+ `all' - highlight the entire message from fool
Any other value disables fool highlighting altogether."
:group 'erc-match
The following values are allowed:
- 'keyword - highlight keyword only
- 'all - highlight the entire message containing keyword
+ `keyword' - highlight keyword only
+ `all' - highlight the entire message containing keyword
Any other value disables keyword highlighting altogether."
:group 'erc-match
The following values are allowed:
- 'nick - highlight nick from dangerous-host only
- 'all - highlight the entire message from dangerous-host
+ `nick' - highlight nick from dangerous-host only
+ `all' - highlight the entire message from dangerous-host
Any other value disables dangerous-host highlighting altogether."
:group 'erc-match
"Flag specifying when matched message logging should happen.
When nil, don't log any matched messages.
When t, log messages.
-When 'away, log messages only when away."
+When `away', log messages only when away."
:group 'erc-match
:type '(choice (const nil)
(const away)
(match-beginning 0)))
(nick-end (when nick-beg
(match-end 0)))
- (message (buffer-substring (if (and nick-end
- (<= (+ 2 nick-end) (point-max)))
- (+ 2 nick-end)
- (point-min))
- (point-max))))
+ (message (buffer-substring
+ (if (and nick-end
+ (<= (+ 2 nick-end) (point-max)))
+ ;; Message starts 2 characters after the nick
+ ;; except for CTCP ACTION messages. Nick
+ ;; surrounded by angle brackets only in normal
+ ;; messages.
+ (+ nick-end
+ (if (eq ?> (char-after nick-end))
+ 2
+ 1))
+ (point-min))
+ (point-max))))
(when (and vector
(not (and erc-match-exclude-server-buffer
(erc-server-buffer-p))))