Subject: Re: bug#19192: 25.0.50; TRAMP uses `dired-listing-switches' for ftp-connection

From: Rasmus <[email-masked]>
Date: Sat, 29 Nov 2014 12:16:43 +0100

Hi,

Sorry for asking so many questions.

Michael Albinus <[email-masked]> writes:

> Rasmus <[email-masked]> writes:
>>> A possible fix might be to give a user an option, whether global
>>> dired-listing-switches shall be used everywhere, or whether there shall
>>> be special settings connection-oriented.
>>
>> So it turns out that arguments are tested via `ange-ftp-switches-ok'.
>> So the easiest fix would probably be to extend this function to do a
>> better job of checking.  Unfortunately, I don't know if one can easily
>> predict which ls commands will be understood and which not?  E.g. does
>> ftp ls depend on the host systems version of ls?
>
> I don't know exactly. But I guess the most stable patch would be to not
> expect too much from ftp's ls.

So according to the note in `ange-ftp-get-files' there's the following
node on using dired-actual-switches or dired-listing-switches

    ;; This is an efficiency hack. We try to
    ;; anticipate what sort of listing dired
    ;; might want, and cache just such a listing.

Switches are checked with `ange-ftp-switches-ok'.  (man "sftp") has a nice list of
switches supported.  Unfortunately, I don't really find anything on
supported ls in the manpage of ftp or the info manual...

Option I: I can limit accepted ls flags by ange-ftp to the subset
supported by sftp.  

Option I+: I could add a defcustom to allow the current more liberal
behavior akin to ange-ftp-passive-host-alist and
ange-ftp-try-passive-mode.

Option II would be to add build-in support for something like the
--group-directories-first in dired, since now, if scrub off
--group-directories-first, a dired-ftp buffer will look different from a
local dired buffer...

For now I will go with Option I.

Thanks,
Rasmus

-- 
The Kids call him Billy the Saint