]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-match.el
Update copyright year to 2015
[gnu-emacs] / lisp / erc / erc-match.el
index f121942736031ad23d1fd6fa8f4c448aa31fab76..776231f80aa6b86d9109afeb54380ee63b8eaf13 100644 (file)
@@ -1,9 +1,9 @@
 ;;; erc-match.el --- Highlight messages matching certain regexps
 
-;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2015 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
 
@@ -452,11 +452,19 @@ Use this defun with `erc-insert-modify-hook'."
                        (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))))