diff options
| author | Stefan Monnier | 2003-10-20 20:54:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-10-20 20:54:16 +0000 |
| commit | 93f4fe7a7751cdd132ac0ab86d15a5d2dfab44fc (patch) | |
| tree | 08f4f60457501d3402c980e55589af50b82eb8c0 | |
| parent | 6c119ac0b46d8233c4582111f9c391044d207a87 (diff) | |
| download | emacs-93f4fe7a7751cdd132ac0ab86d15a5d2dfab44fc.tar.gz emacs-93f4fe7a7751cdd132ac0ab86d15a5d2dfab44fc.zip | |
(PC-do-completion): Do not forget to use `pred' as the default-directory
when completing file names.
| -rw-r--r-- | lisp/complete.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/complete.el b/lisp/complete.el index 567e0fee105..130d0ecb31f 100644 --- a/lisp/complete.el +++ b/lisp/complete.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; complete.el --- partial completion mechanism plus other goodies | 1 | ;;; complete.el --- partial completion mechanism plus other goodies |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000 | 3 | ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2003 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Dave Gillespie <daveg@synaptics.com> | 6 | ;; Author: Dave Gillespie <daveg@synaptics.com> |
| @@ -394,7 +394,9 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 394 | ;; Add wildcards if necessary | 394 | ;; Add wildcards if necessary |
| 395 | (and filename | 395 | (and filename |
| 396 | (let ((dir (file-name-directory str)) | 396 | (let ((dir (file-name-directory str)) |
| 397 | (file (file-name-nondirectory str))) | 397 | (file (file-name-nondirectory str)) |
| 398 | ;; The base dir for file-completion is passed in `predicate'. | ||
| 399 | (default-directory (expand-file-name pred))) | ||
| 398 | (while (and (stringp dir) (not (file-directory-p dir))) | 400 | (while (and (stringp dir) (not (file-directory-p dir))) |
| 399 | (setq dir (directory-file-name dir)) | 401 | (setq dir (directory-file-name dir)) |
| 400 | (setq file (concat (replace-regexp-in-string | 402 | (setq file (concat (replace-regexp-in-string |
| @@ -408,6 +410,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 408 | (and filename | 410 | (and filename |
| 409 | (string-match "\\*.*/" str) | 411 | (string-match "\\*.*/" str) |
| 410 | (let ((pat str) | 412 | (let ((pat str) |
| 413 | ;; The base dir for file-completion is passed in `predicate'. | ||
| 414 | (default-directory (expand-file-name pred)) | ||
| 411 | files) | 415 | files) |
| 412 | (setq p (1+ (string-match "/[^/]*\\'" pat))) | 416 | (setq p (1+ (string-match "/[^/]*\\'" pat))) |
| 413 | (while (setq p (string-match PC-delim-regex pat p)) | 417 | (while (setq p (string-match PC-delim-regex pat p)) |