unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Quotes in Dired listing switches
@ 2009-12-23  9:07 Juri Linkov
  2009-12-24  3:18 ` Stefan Monnier
  2010-01-25  9:29 ` Juri Linkov
  0 siblings, 2 replies; 14+ messages in thread
From: Juri Linkov @ 2009-12-23  9:07 UTC (permalink / raw)
  To: emacs-devel

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/




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

end of thread, other threads:[~2010-01-25 10:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23  9:07 Quotes in Dired listing switches Juri Linkov
2009-12-24  3:18 ` Stefan Monnier
2009-12-26 20:21   ` Michael Albinus
2009-12-28 10:29     ` Juri Linkov
2009-12-28 11:14       ` Michael Albinus
2009-12-28 21:08         ` Juri Linkov
2009-12-29  9:10           ` Michael Albinus
2009-12-29 20:35             ` Juri Linkov
2009-12-29 21:04               ` Michael Albinus
2009-12-29 17:10     ` Stefan Monnier
2009-12-30 19:46       ` Michael Albinus
2010-01-11  0:43   ` Juri Linkov
2010-01-25  9:29 ` Juri Linkov
2010-01-25 10:35   ` Eli Zaretskii

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).