From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Quotes in Dired listing switches Date: Wed, 23 Dec 2009 11:07:27 +0200 Organization: JURTA Message-ID: <87vdfy5om7.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261559578 6193 80.91.229.12 (23 Dec 2009 09:12:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Dec 2009 09:12:58 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 23 10:12:51 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NNNGx-0005ut-Q2 for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2009 10:12:48 +0100 Original-Received: from localhost ([127.0.0.1]:42970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNNGx-0005zY-9J for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2009 04:12:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNNFP-0005M6-QN for emacs-devel@gnu.org; Wed, 23 Dec 2009 04:11:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNNFL-0005Jh-1t for emacs-devel@gnu.org; Wed, 23 Dec 2009 04:11:11 -0500 Original-Received: from [199.232.76.173] (port=34014 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNNFK-0005Jb-RK for emacs-devel@gnu.org; Wed, 23 Dec 2009 04:11:06 -0500 Original-Received: from smtp-out3.starman.ee ([85.253.0.5]:55700 helo=mx1.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNNFK-0003DH-OD for emacs-devel@gnu.org; Wed, 23 Dec 2009 04:11:06 -0500 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.29.24.cable.starman.ee [82.131.29.24]) by mx1.starman.ee (Postfix) with ESMTP id 2D54B3F41CD for ; Wed, 23 Dec 2009 11:10:59 +0200 (EET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118789 Archived-At: 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/