(quail-start-conversion): Reset
[bpt/emacs.git] / lisp / pcomplete.el
index 2b66b1d..0ef1cbd 100644 (file)
@@ -1,10 +1,9 @@
 ;;; pcomplete --- programmable completion
 
-;; Copyright (C) 1999, 2000 Free Sofware Foundation
+;; Copyright (C) 1999, 2000, 2001 Free Sofware Foundation
 
 ;; Author: John Wiegley <johnw@gnu.org>
-;; Keywords: processes
-;; X-URL: http://www.emacs.org/~johnw/emacs.html
+;; Keywords: processes abbrev
 
 ;; This file is part of GNU Emacs.
 
 
 (defgroup pcomplete nil
   "Programmable completion."
+  :version "21.1"
   :group 'processes)
 
 ;;; User Variables:
 
 (defcustom pcomplete-file-ignore nil
   "*A regexp of filenames to be disregarded during file completion."
-  :type 'regexp
+  :type '(choice regexp (const :tag "None" nil))
   :group 'pcomplete)
 
 (defcustom pcomplete-dir-ignore nil
   "*A regexp of names to be disregarded during directory completion."
-  :type 'regexp
+  :type '(choice regexp (const :tag "None" nil))
   :group 'pcomplete)
 
 (defcustom pcomplete-ignore-case (memq system-type '(ms-dos windows-nt))
@@ -303,6 +303,14 @@ This function is used to generate completions for every argument."
   :type 'function
   :group 'pcomplete)
 
+(defcustom pcomplete-use-paring t
+  "*If t, pare alternatives that have already been used.
+If nil, you will always see the completion set of possible options, no
+matter which of those options have already been used in previous
+command arguments."
+  :type 'boolean
+  :group 'pcomplete)
+
 ;;; Internal Variables:
 
 ;; for cycling completion support
@@ -678,7 +686,11 @@ Magic characters are those in `pcomplete-arg-quote-list'."
 (defsubst pcomplete-dirs-or-entries (&optional regexp predicate)
   "Return either directories, or qualified entries."
   (append (let ((pcomplete-stub pcomplete-stub))
-           (pcomplete-entries regexp predicate))
+           (pcomplete-entries
+            regexp (or predicate
+                       (function
+                        (lambda (path)
+                          (not (file-directory-p path)))))))
          (pcomplete-entries nil 'file-directory-p)))
 
 (defun pcomplete-entries (&optional regexp predicate)
@@ -1017,7 +1029,7 @@ extra checking, and munging of the COMPLETIONS list."
           (message "No completions of %s" stub)
         (message "No completions")))
     ;; pare it down, if applicable
-    (if pcomplete-seen
+    (if (and pcomplete-use-paring pcomplete-seen)
        (let* ((arg (pcomplete-arg))
               (prefix
                (file-name-as-directory