]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-pcomplete.el
Update docs for `customize-mode'
[gnu-emacs] / lisp / erc / erc-pcomplete.el
index e46ac68b2594f76c08f54b97ca794d2196a4c89d..9f572396de81b344c24e1551358cfa2286d638ee 100644 (file)
@@ -1,6 +1,6 @@
 ;;; erc-pcomplete.el --- Provides programmable completion for ERC
 
-;; Copyright (C) 2002-2004, 2006-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
 
 ;; Author: Sacha Chua <sacha@free.net.ph>
 ;; Maintainer: emacs-devel@gnu.org
@@ -225,9 +225,10 @@ If optional argument IGNORE-SELF is non-nil, don't return the current nick."
                  (erc-get-channel-user-list)))
         (nicks nil))
     (dolist (user users)
-      (unless (and ignore-self
-                   (string= (erc-server-user-nickname (car user))
-                            (erc-current-nick)))
+      (unless (or (not user) 
+                  (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))))
@@ -237,10 +238,12 @@ If optional argument IGNORE-SELF is non-nil, don't return the current nick."
   "Returns a list of all nicks on the current server."
   (let (nicks)
     (erc-with-server-buffer
-      (maphash (lambda (nick _user)
-                 (setq nicks (cons (concat nick postfix) nicks)))
+      (maphash (lambda (_nick user)
+                 (setq nicks (cons
+                              (concat (erc-server-user-nickname user) postfix)
+                              nicks)))
                erc-server-users))
-      nicks))
+    nicks))
 
 (defun pcomplete-erc-channels ()
   "Returns a list of channels associated with the current server."