aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-11-08 23:39:29 +0000
committerStefan Monnier2002-11-08 23:39:29 +0000
commitc2801b5048cb216396fc24be619b327e43a6cc43 (patch)
tree8897d87ac6ae52f624bf1711366cdfe29b84a233
parentdc0868e1ce1417f5e8b542144ff7db3b0ad6bf81 (diff)
downloademacs-c2801b5048cb216396fc24be619b327e43a6cc43.tar.gz
emacs-c2801b5048cb216396fc24be619b327e43a6cc43.zip
(PC-do-completion): Make partial-completion work
with incomplete directory names.
-rw-r--r--lisp/complete.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/complete.el b/lisp/complete.el
index de58752b636..baa8a5a5f10 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -78,11 +78,6 @@
78;; The regular M-TAB (lisp-complete-symbol) command also supports 78;; The regular M-TAB (lisp-complete-symbol) command also supports
79;; partial completion in this package. 79;; partial completion in this package.
80 80
81;; File name completion does not do partial completion of directories
82;; on the path, e.g., "/u/b/f" will not complete to "/usr/bin/foo",
83;; but you can put *'s in the path to accomplish this: "/u*/b*/f".
84;; Stars are required for performance reasons.
85
86;; In addition, this package includes a feature for accessing include 81;; In addition, this package includes a feature for accessing include
87;; files. For example, `C-x C-f <sys/time.h> RET' reads the file 82;; files. For example, `C-x C-f <sys/time.h> RET' reads the file
88;; /usr/include/sys/time.h. The variable PC-include-file-path is a 83;; /usr/include/sys/time.h. The variable PC-include-file-path is a
@@ -396,6 +391,18 @@ of `minibuffer-completion-table' and the minibuffer contents.")
396 PC-ndelims-regex (concat "[^" PC-delims "]*") 391 PC-ndelims-regex (concat "[^" PC-delims "]*")
397 PC-delims-list (append PC-delims nil))) 392 PC-delims-list (append PC-delims nil)))
398 393
394 ;; Add wildcards if necessary
395 (let ((dir (file-name-directory str))
396 (file (file-name-nondirectory str)))
397 (while (and (stringp dir) (not (file-directory-p dir)))
398 (setq dir (directory-file-name dir))
399 (setq file (concat (replace-regexp-in-string
400 PC-delim-regex "*\\&"
401 (file-name-nondirectory dir))
402 "*/" file))
403 (setq dir (file-name-directory dir)))
404 (setq str (concat dir file)))
405
399 ;; Look for wildcard expansions in directory name 406 ;; Look for wildcard expansions in directory name
400 (and filename 407 (and filename
401 (string-match "\\*.*/" str) 408 (string-match "\\*.*/" str)