emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/erc/erc-capab.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc-capab.el,v
Date: Sun, 01 Apr 2007 13:36:43 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/04/01 13:36:38

Index: lisp/erc/erc-capab.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/erc/erc-capab.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- lisp/erc/erc-capab.el       21 Jan 2007 02:47:36 -0000      1.2
+++ lisp/erc/erc-capab.el       1 Apr 2007 13:36:37 -0000       1.3
@@ -56,8 +56,10 @@
 ;; (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.
 
@@ -73,14 +75,19 @@
   :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
@@ -124,9 +131,9 @@
 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)
@@ -175,7 +182,7 @@
   (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))
@@ -183,10 +190,9 @@
                  (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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]