]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-pcomplete.el
erc-match: fix erc-match server buffer exclusion
[gnu-emacs] / lisp / erc / erc-pcomplete.el
index eb1398d5b052f07ec9deb4fc622e6e3f9a630d4f..d3cbe8a580430d9efa4e706757727f223bc61a09 100644 (file)
@@ -1,6 +1,6 @@
 ;;; erc-pcomplete.el --- Provides programmable completion for ERC
 
-;; Copyright (C) 2002-2004, 2006-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc.
 
 ;; Author: Sacha Chua <sacha@free.net.ph>
 ;; Keywords: comm, convenience
@@ -49,7 +49,7 @@
   :group 'erc)
 
 (defcustom erc-pcomplete-nick-postfix ":"
-  "*When `pcomplete' is used in the first word after the prompt,
+  "When `pcomplete' is used in the first word after the prompt,
 add this string to nicks completed."
   :group 'erc-pcomplete
   :type 'string)
@@ -73,7 +73,10 @@ the most recent speakers are listed first."
   "ERC completion data from pcomplete.
 for use on `completion-at-point-function'."
   (when (> (point) (erc-beg-of-input-line))
-    (pcomplete-completions-at-point)))
+    (or (let ((pcomplete-default-completion-function #'ignore))
+          (pcomplete-completions-at-point))
+        (let ((c (pcomplete-completions-at-point)))
+          (if c (nconc c '(:exclusive no)))))))
 
 (defun erc-pcomplete ()
   "Complete the nick before point."
@@ -94,7 +97,7 @@ for use on `completion-at-point-function'."
   (set (make-local-variable 'pcomplete-use-paring)
        nil)
   (set (make-local-variable 'pcomplete-parse-arguments-function)
-       'pcomplete-parse-erc-arguments)
+       'pcomplete-erc-parse-arguments)
   (set (make-local-variable 'pcomplete-command-completion-function)
        'pcomplete/erc-mode/complete-command)
   (set (make-local-variable 'pcomplete-command-name-function)
@@ -254,7 +257,7 @@ If optional argument IGNORE-SELF is non-nil, don't return the current nick."
       (upcase (substring (pcomplete-arg 'first) 1))
     "SAY"))
 
-(defun pcomplete-parse-erc-arguments ()
+(defun pcomplete-erc-parse-arguments ()
   "Returns a list of parsed whitespace-separated arguments.
 These are the words from the beginning of the line after the prompt
 up to where point is right now."