changeset 14765:844686eabff0

(PC-completion-as-file-name-predicate): Replace PC-do-completion-filename-completers. (PC-do-completion): Use that.
author Richard M. Stallman <rms@gnu.org>
date Wed, 06 Mar 1996 05:12:07 +0000
parents 26224976a917
children aaaef422311b
files lisp/complete.el
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/complete.el	Wed Mar 06 04:37:18 1996 +0000
+++ b/lisp/complete.el	Wed Mar 06 05:12:07 1996 +0000
@@ -257,17 +257,21 @@
 (defvar PC-ndelims-regex nil)
 (defvar PC-delims-list nil)
 
-(defvar PC-do-completion-filename-completers
-  '(read-file-name-internal read-directory-name-internal)
-  "Completion functions that do file-name style completion.
-The elements are compared with the value of `minibuffer-completion-table'.")
+(defvar PC-completion-as-file-name-predicate
+  (function
+   (lambda ()
+     (memq minibuffer-completion-table
+	   '(read-file-name-internal read-directory-name-internal))))
+   "A function testing whether a minibuffer completion now will work filename-style.
+The function takes no arguments, and typically looks at the value
+of `minibuffer-completion-table' and the minibuffer contents.")
 
 (defun PC-do-completion (&optional mode beg end)
   (or beg (setq beg (point-min)))
   (or end (setq end (point-max)))
   (let* ((table minibuffer-completion-table)
 	 (pred minibuffer-completion-predicate)
-	 (filename (memq table PC-do-completion-filename-completers))
+	 (filename (funcall PC-completion-as-file-name-predicate))
 	 (dirname nil)
 	 dirlength
 	 (str (buffer-substring beg end))