diff options
author | Miles Bader <miles@gnu.org> | 2006-07-14 02:29:50 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2006-07-14 02:29:50 +0000 |
commit | 0b6bb13008bc74c054c00b8f9d24507dd9383689 (patch) | |
tree | adf40183ef9d45dbbb00d1ace47e4b245396e198 /lisp/erc/erc-pcomplete.el | |
parent | b96028676212ff2a63baaf7087cd88fdc60f907b (diff) | |
download | emacs-0b6bb13008bc74c054c00b8f9d24507dd9383689.tar.gz |
Update for ERC 5.1.3.
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-348
Creator: Michael Olson <mwolson@gnu.org>
Diffstat (limited to 'lisp/erc/erc-pcomplete.el')
-rw-r--r-- | lisp/erc/erc-pcomplete.el | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index d6d4dfdd3b3..33231ee2590 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -106,7 +106,7 @@ the most recent speakers are listed first." (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 @@ the most recent speakers are listed first." 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." |