# HG changeset patch # User Stefan Monnier # Date 1066683256 0 # Node ID cc2b636ab1dbc64cba34a35e53dca77fd7374b4a # Parent 23548da8a10f27038a98dcfc92b2002907627a64 (PC-do-completion): Do not forget to use `pred' as the default-directory when completing file names. diff -r 23548da8a10f -r cc2b636ab1db lisp/complete.el --- a/lisp/complete.el Mon Oct 20 19:07:02 2003 +0000 +++ b/lisp/complete.el Mon Oct 20 20:54:16 2003 +0000 @@ -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 @@ -394,7 +394,9 @@ ;; 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 @@ (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))