]> git.eshelyaron.com Git - emacs.git/commitdiff
(PC-do-completion): Do not forget to use `pred' as the default-directory
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Oct 2003 20:54:16 +0000 (20:54 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Oct 2003 20:54:16 +0000 (20:54 +0000)
when completing file names.

lisp/complete.el

index 567e0fee10597c0f72c0f807ee49d97b439ebd1b..130d0ecb31f541062b00f165f569b3aa32244f32 100644 (file)
@@ -1,6 +1,6 @@
 ;;; complete.el --- partial completion mechanism plus other goodies
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000
+;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2003
 ;;  Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
@@ -394,7 +394,9 @@ of `minibuffer-completion-table' and the minibuffer contents.")
       ;; Add wildcards if necessary
       (and filename
            (let ((dir (file-name-directory str))
-                 (file (file-name-nondirectory str)))
+                 (file (file-name-nondirectory str))
+                ;; The base dir for file-completion is passed in `predicate'.
+                (default-directory (expand-file-name pred)))
              (while (and (stringp dir) (not (file-directory-p dir)))
                (setq dir (directory-file-name dir))
                (setq file (concat (replace-regexp-in-string
@@ -408,6 +410,8 @@ of `minibuffer-completion-table' and the minibuffer contents.")
       (and filename
           (string-match "\\*.*/" str)
           (let ((pat str)
+                ;; The base dir for file-completion is passed in `predicate'.
+                (default-directory (expand-file-name pred))
                 files)
             (setq p (1+ (string-match "/[^/]*\\'" pat)))
             (while (setq p (string-match PC-delim-regex pat p))