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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 29 Apr 2023 18:16:05 +0300

> From: Ruijie Yu <[email-masked]>
> Cc: Yuri D'Elia <[email-masked]>, [email-masked]
> Date: Sat, 29 Apr 2023 23:05:27 +0800
> 
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Does the patch below give good results?
> >
> > diff --git a/lisp/dired.el b/lisp/dired.el
> > index d1471e9..e3a9d7b 100644
> > --- a/lisp/dired.el
> > +++ b/lisp/dired.el
> > @@ -1653,7 +1653,10 @@ dired-insert-directory
> >  see `dired-use-ls-dired' for more details.")
> >  		       nil))
> >  	       dired-use-ls-dired)))
> > -	(setq switches (concat "--dired " switches)))
> > +        ;; Use -N with --dired, to countermand possible non-default
> > +        ;; quoting style, in particular via the environment variable
> > +        ;; QUOTINTG_STYLE.
> > +	(setq switches (concat "--dired -N " switches)))
> >      ;; Expand directory wildcards and fill file-list.
> >      (let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir)))
> >        (cond (dir-wildcard
> 
> Do we need to prevent "wild" users from setting a conflicting quoting
> style in `switches'

Why would we want to do that?  If they think they know what they are
doing, let them live with the consequences.