(comint-dynamic-complete): Expand PATHDIR in call to file-name-completion.
authorRoland McGrath <roland@gnu.org>
Mon, 2 Aug 1993 23:04:05 +0000 (23:04 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 2 Aug 1993 23:04:05 +0000 (23:04 +0000)
lisp/comint.el

index 44f0968..cfa8f61 100644 (file)
@@ -1184,8 +1184,15 @@ it just adds completion characters to the end of the filename."
   (let* ((pathname (comint-match-partial-pathname))
         (pathdir (file-name-directory pathname))
         (pathnondir (file-name-nondirectory pathname))
-        (completion (file-name-completion  pathnondir
-                                          (or pathdir default-directory))))
+        (completion (file-name-completion
+                     pathnondir
+                     ;; It is important to expand PATHDIR because
+                     ;; default-directory might be a handled name, and the
+                     ;; unexpanded PATHDIR won't necessarily match the
+                     ;; handler regexp.
+                     (if pathdir
+                         (expand-file-name pathdir)
+                       default-directory))))
     (cond ((null completion)
           (message "No completions of %s" pathname)
           (ding))