Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired

From: Yuri D'Elia <[email-masked]>
Date: Fri, 28 Apr 2023 20:01:01 +0200

On Fri, Apr 28 2023, Eli Zaretskii wrote:
>> > I'd suggest first to report this to Coreutils maintainers: it makes
>> > little sense to me to honor QUOTING_STYLE when --dired is specified.
>> > If the Coreutils folks decline to handle this, then I guess we will
>> > have to.
>>
>> What sort of output should ls use in --dired mode?
>
> The default one, I think.  --dired already produces the information
> which tells where each file name begins and ends, so any quoting
> sounds redundant, no?

So searching through coreutils I find this old report:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23024

| On further analysis I see that --dired mode already distinguishes
| the quoting-style in its output.  Also we had already documented
| that --dired should specify a --quoting-style to get consistent output.

Which huh, does mention this in the ls manual:

| If you use a quoting style like ‘--quoting-style=c’ (‘-Q’) that
|  adds quote marks, then the offsets include the quote marks.  So
|  beware that the user may select the quoting style via the
|  environment variable ‘QUOTING_STYLE’.  Hence, applications using
|  ‘--dired’ should either specify an explicit
|  ‘--quoting-style=literal’ (‘-N’) option on the command line, or
|  else be prepared to parse the escaped names.

Then it references a commit mentioning an emacs fix:

https://github.com/emacs-mirror/emacs/commit/e4adb6

which however seems to apply to tramp only.