unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* directory-files and Tramp
@ 2003-02-21 23:16 Lars Hansen
  2003-02-22 12:23 ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Hansen @ 2003-02-21 23:16 UTC (permalink / raw)
  Cc: emacs-devel

Tramp is not handling the call (directory-files directory) when 
directory is relative and default-directory a Tramp file.
I beleive the problem can be fixed with the following patch:

diff -c dired-original.c dired.c
*** dired-original.c    Tue Feb  4 15:03:12 2003
--- dired.c    Fri Feb 21 21:07:26 2003
***************
*** 346,351 ****
--- 346,353 ----
  {
    Lisp_Object handler;
 
+   directory = Fexpand_file_name (directory, Qnil);
+
    /* If the file name has special constructs in it,
       call the corresponding file handler.  */
    handler = Ffind_file_name_handler (directory, Qdirectory_files);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: directory-files and Tramp
  2003-02-21 23:16 directory-files and Tramp Lars Hansen
@ 2003-02-22 12:23 ` Kai Großjohann
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Großjohann @ 2003-02-22 12:23 UTC (permalink / raw)


Lars Hansen <larsh@math.ku.dk> writes:

> Tramp is not handling the call (directory-files directory) when
> directory is relative and default-directory a Tramp file.
> I beleive the problem can be fixed with the following patch:
>
> diff -c dired-original.c dired.c
> *** dired-original.c    Tue Feb  4 15:03:12 2003
> --- dired.c    Fri Feb 21 21:07:26 2003
> ***************
> *** 346,351 ****
> --- 346,353 ----
>   {
>     Lisp_Object handler;
>  +   directory = Fexpand_file_name (directory, Qnil);
> +
>     /* If the file name has special constructs in it,
>        call the corresponding file handler.  */
>     handler = Ffind_file_name_handler (directory, Qdirectory_files);

I think it looks good: in the no-handler case, directory_files calls
directory_files_internal, which in turn calls expand-file-name on the
directory.  So expand-file-name is called anyway.

But should the expand-file-name call in directory_files_internal be
removed after making sure that all callers do the expansion?
-- 
A preposition is not a good thing to end a sentence with.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: directory-files and Tramp
@ 2003-02-22 22:38 Lars Hansen
  2003-02-23 10:48 ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Hansen @ 2003-02-22 22:38 UTC (permalink / raw)
  Cc: emacs-devel

>
>
>I think it looks good: in the no-handler case, directory_files calls
>directory_files_internal, which in turn calls expand-file-name on the
>directory.  So expand-file-name is called anyway.
>
>But should the expand-file-name call in directory_files_internal be
>removed after making sure that all callers do the expansion?
>
Sounds like a good idea. I seems directory_files_internal is called by 
directory-files and
directory-files-and-attributes only. But the latter is missing a call to 
expand-file-name, so
it must have the same problem as directory-files. So i think the changes 
should be:

diff -c dired-original.c dired.c
*** dired-original.c    Tue Feb  4 15:03:12 2003
--- dired.c    Sat Feb 22 23:19:18 2003
***************
*** 153,159 ****
       Ffuncall, and cause a GC.  */
    list = encoded_directory = dirfilename = Qnil;
    GCPRO5 (match, directory, list, dirfilename, encoded_directory);
-   directory = Fexpand_file_name (directory, Qnil);
    dirfilename = Fdirectory_file_name (directory);
 
    if (!NILP (match))
--- 153,158 ----
***************
*** 346,351 ****
--- 345,352 ----
  {
    Lisp_Object handler;
 
+   directory = Fexpand_file_name (directory, Qnil);
+
    /* If the file name has special constructs in it,
       call the corresponding file handler.  */
    handler = Ffind_file_name_handler (directory, Qdirectory_files);
***************
*** 379,384 ****
--- 380,387 ----
  {
    Lisp_Object handler;
 
+   directory = Fexpand_file_name (directory, Qnil);
+
    /* If the file name has special constructs in it,
       call the corresponding file handler.  */
    handler = Ffind_file_name_handler (directory, 
Qdirectory_files_and_attributes);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: directory-files and Tramp
  2003-02-22 22:38 Lars Hansen
@ 2003-02-23 10:48 ` Kai Großjohann
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Großjohann @ 2003-02-23 10:48 UTC (permalink / raw)


Lars Hansen <larsh@math.ku.dk> writes:

> Sounds like a good idea. I seems directory_files_internal is called
> by directory-files and directory-files-and-attributes only. But the
> latter is missing a call to expand-file-name, so it must have the
> same problem as directory-files. So i think the changes should be:

Committed.

-- 
A preposition is not a good thing to end a sentence with.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-02-23 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-21 23:16 directory-files and Tramp Lars Hansen
2003-02-22 12:23 ` Kai Großjohann
  -- strict thread matches above, loose matches on Subject: below --
2003-02-22 22:38 Lars Hansen
2003-02-23 10:48 ` Kai Großjohann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).