[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: default-directory and file-name-all-completions
From: |
Michael Albinus |
Subject: |
Re: default-directory and file-name-all-completions |
Date: |
Sun, 14 Oct 2007 11:53:14 +0200 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) |
Stephen Eglen <address@hidden> writes:
> Dear Michael,
Hi Stephen,
> > I can reproduce the problem here. The point is that the way you call
> > file-name-all-completions, it doesn't reach Tramp. Whether Tramp is
> > involved or not is decided by the DIRECTORY parameter of
> > file-name-all-completions. It shall be expanded before that check, but
> > it isn't - I would say it is an error in file-name-all-completions.
>
> Ok -- is that worth me taking up with a bug report on emacs-devel?
The elisp reference says for file-name-all-completions
The current buffer's default directory is prepended to DIRECTORY,
if DIRECTORY is not absolute.
Yes, I would say it is a bug worth to be reported.
> Unfortunately, although that fixes my test case, it doesn't fix the
> real problem within ESS, since the call is something like:
> (file-name-all-completions "Splus" var)
>
> and var iterates over the elements in $PATH (and hence the problem
> occurs if "." is on the PATH.
I see. I guess we are speaking about ess-find-exec-completions. What
about this change:
(while ess-exec-path
(setq ess-tmp-dir (expand-file-name (car ess-exec-path))
ess-exec-path (cdr ess-exec-path))
(setq ess-tmp-files
(file-name-all-completions ess-root-arg ess-tmp-dir))
This would avoid also the special test for a zero-length element in
ess-exec-path. And it doesn't break when the bug in
file-name-all-completions has been fixed.
However, it might be problematic to use exec-path as default for
ess-exec-dir in the Tramp case. exec-path contains only local
directories (derived from local environment variable $PATH), which might
be different from remote directories to be used.
> Thanks, Stephen
Best regards, Michael.