emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quotes in Dired listing switches


From: Stefan Monnier
Subject: Re: Quotes in Dired listing switches
Date: Wed, 23 Dec 2009 22:18:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

>   (setq dired-listing-switches "-al --block-size=\"'1\"")
[...]
> (apply 'call-process
>        insert-directory-program nil t nil
>        '("--dired" "-al" "--block-size=\"'1\"" "--" "/tmp/."))
[...]
> then Dired works correctly, but with e.g. `C-x d /sudo::/tmp'
> Tramp hangs because the unmatched single quote causes the shell
> to wait for the closing quote.

Obviously, there's a problem in the inconsistent parsing of
dired-listing-switches, where the basic code splits it at spaces without
doing any additional unquoting or analysis, whereas the Tramp code seems
to just pass it as-is to the shell (so if you set it to "-al $(rm -rf ~/.)"
it will try to do something funny).
I won't claim that the basic code's naive splitting is great, but
Tramp's similarly naive use is not great either.  So, I suggest to treat
it as a bug in Tramp which should split it like the basic code and then
shell-quote-argument the parts.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]