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-pcomplete.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc-pcomplete.el,v
Date: Fri, 14 Jul 2006 02:29:51 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     06/07/14 02:29:50

Index: lisp/erc/erc-pcomplete.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/erc/erc-pcomplete.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- lisp/erc/erc-pcomplete.el   12 Feb 2006 20:25:00 -0000      1.2
+++ lisp/erc/erc-pcomplete.el   14 Jul 2006 02:29:49 -0000      1.3
@@ -106,7 +106,7 @@
   (pcomplete-here
    (append
     (pcomplete-erc-commands)
-    (pcomplete-erc-nicks erc-pcomplete-nick-postfix))))
+    (pcomplete-erc-nicks erc-pcomplete-nick-postfix t))))
 
 (defvar erc-pcomplete-ctcp-commands
   '("ACTION" "CLIENTINFO" "ECHO" "FINGER" "PING" "TIME" "USERINFO" "VERSION"))
@@ -212,14 +212,23 @@
     not-ops))
 
 
-(defun pcomplete-erc-nicks (&optional postfix)
-  "Returns a list of nicks in the current channel."
-  (let ((users (erc-get-channel-user-list)))
-    (if erc-pcomplete-order-nickname-completions
-        (setq users (erc-sort-channel-users-by-activity users)))
-  (mapcar (lambda (x)
-              (concat (erc-server-user-nickname (car x)) postfix))
-            users)))
+(defun pcomplete-erc-nicks (&optional postfix ignore-self)
+  "Returns a list of nicks in the current channel.
+Optional argument POSTFIX is something to append to the nickname.
+If optional argument IGNORE-SELF is non-nil, don't return the current nick."
+  (let ((users (if erc-pcomplete-order-nickname-completions
+                   (erc-sort-channel-users-by-activity
+                    (erc-get-channel-user-list))
+                 (erc-get-channel-user-list)))
+        (nicks nil))
+    (dolist (user users)
+      (unless (and ignore-self
+                   (string= (erc-server-user-nickname (car user))
+                            (erc-current-nick)))
+        (setq nicks (cons (concat (erc-server-user-nickname (car user))
+                                  postfix)
+                          nicks))))
+    (nreverse nicks)))
 
 (defun pcomplete-erc-all-nicks (&optional postfix)
   "Returns a list of all nicks on the current server."




reply via email to

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