[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Quotes in Dired listing switches
From: |
Juri Linkov |
Subject: |
Quotes in Dired listing switches |
Date: |
Wed, 23 Dec 2009 11:07:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (x86_64-pc-linux-gnu) |
To make file sizes in Dired more readable, `ls' provides the option
`--block-size'. (info "(coreutils) What information is listed") says:
`--block-size="'1"' prints a byte count with the thousands
separator of the current locale.
However, this doesn't work in Dired when set by `dired-listing-switches'.
After setting
(setq dired-listing-switches "-al --block-size=\"'1\"")
`C-x d' fails with the error message:
insert-directory: Listing directory failed but `access-file' worked
because in `insert-directory', `call-process' called as
(apply 'call-process
insert-directory-program nil t nil
'("--dired" "-al" "--block-size=\"'1\"" "--" "/tmp/."))
creates a Dired buffer with the following line:
/bin/ls: invalid --block-size argument `"'1"'
When using `--block-size' without double quotes
(setq dired-listing-switches "-al --block-size='1")
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.
Fortunately, (info "(coreutils) Block size") mentions the
environment variable `LS_BLOCK_SIZE' that indeed works with:
(setenv "LS_BLOCK_SIZE" "'1")
without using Dired switches.
But I still have a question: would it be possible to solve this problem
without resorting to an environment variable that may not exist
for other similar cases?
--
Juri Linkov
http://www.jurta.org/emacs/
- Quotes in Dired listing switches,
Juri Linkov <=
- Re: Quotes in Dired listing switches, Stefan Monnier, 2009/12/23
- Re: Quotes in Dired listing switches, Michael Albinus, 2009/12/26
- Re: Quotes in Dired listing switches, Juri Linkov, 2009/12/28
- Re: Quotes in Dired listing switches, Michael Albinus, 2009/12/28
- Re: Quotes in Dired listing switches, Juri Linkov, 2009/12/28
- Re: Quotes in Dired listing switches, Michael Albinus, 2009/12/29
- Re: Quotes in Dired listing switches, Juri Linkov, 2009/12/29
- Re: Quotes in Dired listing switches, Michael Albinus, 2009/12/29
- Re: Quotes in Dired listing switches, Stefan Monnier, 2009/12/30
- Re: Quotes in Dired listing switches, Michael Albinus, 2009/12/30