all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dired uses wrong `ls' switches for Tramp
@ 2002-09-16 14:18 Kai Großjohann
  2002-09-16 14:31 ` Kai Großjohann
  2002-09-17 15:53 ` Richard Stallman
  0 siblings, 2 replies; 8+ messages in thread
From: Kai Großjohann @ 2002-09-16 14:18 UTC (permalink / raw)


In dired-insert-directory, I see that "--dired" is added to the list
of switches if the local ls groks that argument.

But the remote ls might not grok it, so I'm looking for a way to
prevent "--dired" from being added in those cases.

dired-insert-directory is not a filename operation, and
dired-insert-directory explicitly calls insert-directory with the
"--dired" switch.

What to do?

(I guess I could try to buffer-locally set dired-use-ls-dired in
dired buffers if default-directory points to a Tramp directory.)

Does somebody know how Ange-FTP circumvents this problem?

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-16 14:18 dired uses wrong `ls' switches for Tramp Kai Großjohann
@ 2002-09-16 14:31 ` Kai Großjohann
  2002-09-17 15:53 ` Richard Stallman
  1 sibling, 0 replies; 8+ messages in thread
From: Kai Großjohann @ 2002-09-16 14:31 UTC (permalink / raw)


Kai.Grossjohann@cs.uni-dortmund.de (Kai Großjohann) writes:

> Does somebody know how Ange-FTP circumvents this problem?

I now see that Ange-FTP has the same problem.  (My previous check was
bogus; didn't actually invoke Ange-FTP.)

Here's the output from listing
/ftp:ftp@ls6-ftp.cs.uni-dortmund.de:/pub/ with dired:

/----
| ftp> open ls6-ftp
| Connected to hobbiton.
| 220 hobbiton FTP server (SunOS 5.6) ready.
| user "ftp" Turtle Power!
| Remote system type is UNIX.
| Using binary mode to transfer files.
| ftp> 331 Guest login ok, send ident as password.
| 230 Guest login ok, access restrictions apply.
| hash
| Remote system type is UNIX.
| Using binary mode to transfer files.
| ftp> Hash mark printing on (1024 bytes/hash mark).
| pwd
| ftp> 257 "/" is current directory.
| cd /pub/
| ftp> 250 CWD command successful.
| ls -al /tmp/ange-ftp1053HLG
| ftp> 200 PORT command successful.
| 150 ASCII data connection for /bin/ls (129.217.19.80,37877) (0 bytes).
| 226 ASCII Transfer complete.
| cd /pub/src/emacs/
| ftp> 250 CWD command successful.
| ls -al /tmp/ange-ftp1053UVM
| ftp> 200 PORT command successful.
| 150 ASCII data connection for /bin/ls (129.217.19.80,37878) (0 bytes).
| 226 ASCII Transfer complete.
| cd /pub/projects/medoc/
| ftp> 250 CWD command successful.
| ls -al /tmp/ange-ftp1053hfS
| ftp> 200 PORT command successful.
| 150 ASCII data connection for /bin/ls (129.217.19.80,37879) (0 bytes).
| 226 ASCII Transfer complete.
| ftp> cd /
| 250 CWD command successful.
| ls -al /tmp/ange-ftp1053upY
| ftp> 200 PORT command successful.
| 150 ASCII data connection for /bin/ls (129.217.19.80,37880) (0 bytes).
| 226 ASCII Transfer complete.
| cd /pub/
| ftp> 250 CWD command successful.
| ls --dired -al /tmp/ange-ftp10537ze
| ftp> usage: ls remote-directory local-file
| ls --dired -al /tmp/ange-ftp10537ze
| ftp> usage: ls remote-directory local-file
| ftp> 
\----

I think that means a general solution is needed.

One idea would be to add a FOR-DIRED argument to insert-directory
which adds the corresponding switch.  Then the filename handlers can
do the right thing.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-16 14:18 dired uses wrong `ls' switches for Tramp Kai Großjohann
  2002-09-16 14:31 ` Kai Großjohann
@ 2002-09-17 15:53 ` Richard Stallman
  2002-09-18  7:49   ` Kai Großjohann
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2002-09-17 15:53 UTC (permalink / raw)
  Cc: emacs-devel

    In dired-insert-directory, I see that "--dired" is added to the list
    of switches if the local ls groks that argument.

    But the remote ls might not grok it, so I'm looking for a way to
    prevent "--dired" from being added in those cases.

I think it should test file-remote-p, and refrain from using
--dired for any remote files.  This is right because there is never
any way to tell whether the remote file system supports --dired.

I can imagine another, more laborious approach: to make Tramp and
Ange-FTP notice the --dired option and "handle" it.  However, they
ucan't handle it with full correctness; the most they could do is scan
the output to identify the file names and fake up the --dired output
to go with them.  This would produce results that are no better than
Dired can get without the --dired option.  So this approach would be
lots of extra work and no real benefit.

Would you like to install the call to file-remote-p?

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-17 15:53 ` Richard Stallman
@ 2002-09-18  7:49   ` Kai Großjohann
  2002-09-18  9:16     ` Miles Bader
  2002-09-19 15:16     ` Richard Stallman
  0 siblings, 2 replies; 8+ messages in thread
From: Kai Großjohann @ 2002-09-18  7:49 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     In dired-insert-directory, I see that "--dired" is added to the list
>     of switches if the local ls groks that argument.
>
>     But the remote ls might not grok it, so I'm looking for a way to
>     prevent "--dired" from being added in those cases.
>
> I think it should test file-remote-p, and refrain from using
> --dired for any remote files.  This is right because there is never
> any way to tell whether the remote file system supports --dired.

Tramp can just run "ls --dired" and see if ls complains.  Using a
similar method, Tramp already finds out a lot of things about the
remote system.

So your suggestion is safe, though it might abstain from "--dired" to
often.

> I can imagine another, more laborious approach: to make Tramp and
> Ange-FTP notice the --dired option and "handle" it.  However, they
> ucan't handle it with full correctness; the most they could do is scan
> the output to identify the file names and fake up the --dired output
> to go with them.  This would produce results that are no better than
> Dired can get without the --dired option.  So this approach would be
> lots of extra work and no real benefit.

Well, what is possible is to remove "--dired" from the list of args
to "ls".  This is also tricky, however, as the string should not be
removed from the command "ls -- --dired", for example.

> Would you like to install the call to file-remote-p?

I'll do that.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-18  7:49   ` Kai Großjohann
@ 2002-09-18  9:16     ` Miles Bader
  2002-09-19 15:16     ` Richard Stallman
  1 sibling, 0 replies; 8+ messages in thread
From: Miles Bader @ 2002-09-18  9:16 UTC (permalink / raw)
  Cc: rms, emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> Tramp can just run "ls --dired" and see if ls complains.  Using a
> similar method, Tramp already finds out a lot of things about the
> remote system.

... and tramp connection is already ridiculously slow; it doesn't seem
like a good idea to add stuff more stuff unless it's really necessary.

-Miles
-- 
We live, as we dream -- alone....

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-18  7:49   ` Kai Großjohann
  2002-09-18  9:16     ` Miles Bader
@ 2002-09-19 15:16     ` Richard Stallman
  2002-09-19 17:29       ` Kai Großjohann
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2002-09-19 15:16 UTC (permalink / raw)
  Cc: emacs-devel

    Tramp can just run "ls --dired" and see if ls complains.

If that works well, please do it.

It is easy to see if --dired is in the ls options
since it would always be at the beginning.
(It's not reasonable for the user to specify that option;
it should only come from dired-insert-directory,
since dired-insert-directory has to know about it and parse
the extra output.)

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-19 15:16     ` Richard Stallman
@ 2002-09-19 17:29       ` Kai Großjohann
  2002-09-20  3:44         ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2002-09-19 17:29 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Tramp can just run "ls --dired" and see if ls complains.
>
> If that works well, please do it.
>
> It is easy to see if --dired is in the ls options
> since it would always be at the beginning.
> (It's not reasonable for the user to specify that option;
> it should only come from dired-insert-directory,
> since dired-insert-directory has to know about it and parse
> the extra output.)

Okay.  So I think that the following is my todo list:

* Change ange-ftp-insert-directory to remove the "--dired" option, if
  present.

* Change Tramp to see if the remote ls groks "--dired".  Depending on
  the outcome, tramp-handle-insert-directory removes the option or
  leaves it in.

* Change dired-insert-directory to always pass "--dired" for remote
  files.  (It could depend on dired-use-ls-dired, but that wouldn't
  make sense.)

If nobody objects, I'll do that as soon as I have time.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

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

* Re: dired uses wrong `ls' switches for Tramp
  2002-09-19 17:29       ` Kai Großjohann
@ 2002-09-20  3:44         ` Richard Stallman
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2002-09-20  3:44 UTC (permalink / raw)
  Cc: emacs-devel

    Okay.  So I think that the following is my todo list:

It looks like a good plan to me.

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

end of thread, other threads:[~2002-09-20  3:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-16 14:18 dired uses wrong `ls' switches for Tramp Kai Großjohann
2002-09-16 14:31 ` Kai Großjohann
2002-09-17 15:53 ` Richard Stallman
2002-09-18  7:49   ` Kai Großjohann
2002-09-18  9:16     ` Miles Bader
2002-09-19 15:16     ` Richard Stallman
2002-09-19 17:29       ` Kai Großjohann
2002-09-20  3:44         ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.