GNU bug report logs - #18875
25.0.50; Dired -- add support for ls --time-style with a space

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Tue, 28 Oct 2014 16:45:02 UTC

Severity: minor

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 18875 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Keith David Bershatsky <esq <at> lawlist.com>, 18875 <at> debbugs.gnu.org
Subject: Re: bug#18875: 25.0.50; Dired -- add support for ls --time-style
 with a space
Date: Mon, 23 Aug 2021 10:18:45 +0300
>> The commit 04f723dec944eaa7b5e99373840a8bf920ba5fdd
>> broke my config with the error signaled by insert-directory:
>> (error "Listing directory failed but ‘access-file’ worked")
>>
>> When dired-listing-switches is customized to
>> "-Alv --block-size='1"
>
> Hm, well, that's not a valid shell string, is it?
>
> It should be "-Alv --block-size=\"'1\"" or something like that to be
> valid...

Then split-string-shell-command parses correctly:
(split-string-shell-command "-Alv --block-size=\"'1\"")
("-Alv" "--block-size='1")

but split-string-and-unquote fails:
(split-string-and-unquote "-Alv --block-size=\"'1\"")
("-Alv" "--block-size=" "'1")

> Hm...  Oh!  The doc string actually documents this (that it's not using
> shell quoting).
>
> ---
> Options that include embedded whitespace must be quoted
> like this: "--option=value with spaces"; you can use
> ‘combine-and-quote-strings’ to produce the correct quoting of
> each option.
> ---

Ah, now I see what is the correct way, and indeed both functions work
when dired-listing-switches is customized to "-Alv \"--block-size='1\"".

(split-string-shell-command "-Alv \"--block-size='1\"")
("-Alv" "--block-size='1")

(split-string-and-unquote "-Alv \"--block-size='1\"")
("-Alv" "--block-size='1")

> So this was the original answer to this bug report.  I'll revert the
> change.

Thanks, it's good that don't need to amend the existing customization.




This bug report was last modified 3 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.