;;; erc-capab.el --- support for dancer-ircd and hyperion's CAPAB
-;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; From freenode.net's web site (not there anymore) on how to mark
;; unidentified users:
;; "We recommend that you add an asterisk before the nick, and
-;; optionally either highlight or colourize the line in some
+;; optionally either highlight or colorize the line in some
;; appropriate fashion, if the user is not identified."
;;; Usage:
;; (erc-capab-identify-mode 1)
;; `erc-capab-identify-prefix' will now be added to the beginning of
-;; unidentified users' nicknames. The default is an asterisk, "*". If
-;; the value of this variable is nil or you disable this module (see
+;; unidentified users' nicknames. The default is an asterisk, "*".
+;; You can customize the prefix and the face used to display it,
+;; `erc-capab-identify-unidentified'. If the value of
+;; `erc-capab-identify-prefix' is nil or you disable this module (see
;; `erc-capab-identify-disable'), no prefix will be inserted, but the
;; flag sent by the server will still be stripped.
:group 'erc)
(defcustom erc-capab-identify-prefix "*"
- "The prefix used for unidentified users."
+ "The prefix used for unidentified users.
+
+If you change this from the default \"*\", be sure to use a
+character not found in IRC nicknames to avoid confusion."
:group 'erc-capab
:type '(choice string (const nil)))
-;;; Define module:
+(defface erc-capab-identify-unidentified '((t)) ; same as `erc-default-face'
+ "Face to use for `erc-capab-identify-prefix'."
+ :group 'erc-capab
+ :group 'erc-faces)
-(define-erc-response-handler (290)
- "Handle dancer-ircd CAPAB messages." nil nil)
+;;; Define module:
;;;###autoload (autoload 'erc-capab-identify-mode "erc-capab" nil t)
(define-erc-module capab-identify nil
These arguments are sent to this function when called as a hook in
`erc-server-005-functions'."
(unless erc-capab-identify-sent
- (erc-capab-send-identify-messages)))
+ (erc-capab-identify-send-messages)))
-(defun erc-capab-send-identify-messages ()
+(defun erc-capab-identify-send-messages ()
"Send CAPAB IDENTIFY messages if the server supports it."
(when (and (stringp erc-server-version)
(string-match "^\\(dancer-ircd\\|hyperion\\)" erc-server-version)
(when (and erc-capab-identify-prefix
(erc-with-server-buffer erc-capab-identify-activated))
(goto-char (or (erc-find-parsed-property) (point-min)))
- (let ((nickname (erc-capab-get-unidentified-nickname
+ (let ((nickname (erc-capab-identify-get-unidentified-nickname
(erc-get-parsed-vector (point)))))
(when (and nickname
(goto-char (point-min))
(re-search-forward (regexp-quote nickname) nil t))
(goto-char (match-beginning 0))
(insert (erc-propertize erc-capab-identify-prefix
- 'face (get-char-property (- (point) 1)
- 'face)))))))
+ 'face 'erc-capab-identify-unidentified))))))
-(defun erc-capab-get-unidentified-nickname (parsed)
+(defun erc-capab-identify-get-unidentified-nickname (parsed)
"Return the nickname of the user if unidentified.
PARSED is an `erc-parsed' response struct."
(when (and (erc-response-p parsed)
(provide 'erc-capab)
-;; arch-tag: 27b6d668-7ee5-4e47-b9f0-27d7a4362062
;;; erc-capab.el ends here