GNU bug report logs -
#55743
28.1.50; No directory error in comp-run-async-workers
Previous Next
Full log
Message #17 received at 55743 <at> debbugs.gnu.org (full text, mbox):
>>> So here are two problems: why completion sets default-directory to non-existent dir,
>>
>> That's the real problem.
>
> Oh, I see, it's a known problem. In completion-setup-function:
>
> (base-dir
> ;; FIXME: This is a bad hack. We try to set the default-directory
> ;; in the *Completions* buffer so that the relative file names
> ;; displayed there can be treated as valid file names, independently
> ;; from the completion context. But this suffers from many problems:
> ;; - It's not clear when the completions are file names. With some
> ;; completion tables (e.g. bzr revision specs), the listed
> ;; completions can mix file names and other things.
> ;; - It doesn't pay attention to possible quoting.
> ;; - With fancy completion styles, the code below will not always
> ;; find the right base directory.
> (if minibuffer-completing-file-name
> (file-name-as-directory
> (expand-file-name
> (buffer-substring (minibuffer-prompt-end) (point)))))))
> ...
> (if base-dir (setq default-directory base-dir))
The problem can be solved by this patch that handles both the most
frequent cases: when the completion string is the default directory,
and when a file prefix is added to it.
diff --git a/lisp/simple.el b/lisp/simple.el
index 103e7f33dd..81e04f28e9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9803,7 +9802,7 @@ completion-setup-function
;; - With fancy completion styles, the code below will not always
;; find the right base directory.
(if minibuffer-completing-file-name
- (file-name-as-directory
+ (file-name-directory
(expand-file-name
(buffer-substring (minibuffer-prompt-end) (point)))))))
(with-current-buffer standard-output
This bug report was last modified 3 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.