GNU bug report logs - #63142
30.0.50; QUOTING_STYLE can break dired

Previous Next

Package: emacs;

Reported by: Yuri D'Elia <wavexx <at> thregr.org>

Date: Fri, 28 Apr 2023 09:47:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63142 in the body.
You can then email your comments to 63142 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 09:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx <at> thregr.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 28 Apr 2023 09:47:02 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 28 Apr 2023 11:35:09 +0200
If the environment variable QUOTING_STYLE is set, GNU "ls" can return a
format that dired doesn't like.

QUOTING_STYLE=shell will quote files with spaces such as 'a b', and
trying to interact with these files with dired results in:

dired-get-file-for-visit: File no longer exists; type g to update Dired buffer

Interestingly, even using "ls --dired" does the same if QUOTING_STYLE is
set.

Should dired handle QUOTING_STYLE (looking at the coreutils manual it
seems that other tools besides ls handle it) or should dired actively
suppress the quoting mode?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 10:29:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 28 Apr 2023 13:28:42 +0300
> From: Yuri D'Elia <wavexx <at> thregr.org>
> Date: Fri, 28 Apr 2023 11:35:09 +0200
> 
> 
> If the environment variable QUOTING_STYLE is set, GNU "ls" can return a
> format that dired doesn't like.
> 
> QUOTING_STYLE=shell will quote files with spaces such as 'a b', and
> trying to interact with these files with dired results in:
> 
> dired-get-file-for-visit: File no longer exists; type g to update Dired buffer
> 
> Interestingly, even using "ls --dired" does the same if QUOTING_STYLE is
> set.
> 
> Should dired handle QUOTING_STYLE (looking at the coreutils manual it
> seems that other tools besides ls handle it) or should dired actively
> suppress the quoting mode?

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.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 10:30:02 GMT) Full text and rfc822 format available.

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

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: bug-gnu-emacs <at> gnu.org, 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 28 Apr 2023 18:27:56 +0800
Yuri D'Elia <wavexx <at> thregr.org> writes:

> If the environment variable QUOTING_STYLE is set, GNU "ls" can return a
> format that dired doesn't like.
>
> QUOTING_STYLE=shell will quote files with spaces such as 'a b', and
> trying to interact with these files with dired results in:
>
> dired-get-file-for-visit: File no longer exists; type g to update Dired buffer
>
> Interestingly, even using "ls --dired" does the same if QUOTING_STYLE is
> set.

Are you suggesting that for ls, passing --dired should also override the
quoting style?  Either way, we can also pass --quoting-style onto the
command line to override it to something dired can play with.

> Should dired handle QUOTING_STYLE (looking at the coreutils manual it
> seems that other tools besides ls handle it) or should dired actively
> suppress the quoting mode?

-- 
Best,


RY

[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 10:30:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 10:40:02 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 28 Apr 2023 12:37:38 +0200
On Fri, Apr 28 2023, Eli Zaretskii wrote:
>> Should dired handle QUOTING_STYLE (looking at the coreutils manual it
>> seems that other tools besides ls handle it) or should dired actively
>> suppress the quoting mode?
>
> 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?

literal?

From the documentation it seems that '-b' should be used to interact
with newlines, so some form of quoting might still be wanted?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 10:46:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 28 Apr 2023 13:46:15 +0300
> From: Yuri D'Elia <wavexx <at> thregr.org>
> Cc: 63142 <at> debbugs.gnu.org
> Date: Fri, 28 Apr 2023 12:37:38 +0200
> 
> On Fri, Apr 28 2023, Eli Zaretskii wrote:
> >> Should dired handle QUOTING_STYLE (looking at the coreutils manual it
> >> seems that other tools besides ls handle it) or should dired actively
> >> suppress the quoting mode?
> >
> > 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 28 Apr 2023 18:04:01 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Sat, 29 Apr 2023 10:47:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Sat, 29 Apr 2023 13:46:54 +0300
> From: Yuri D'Elia <wavexx <at> thregr.org>
> Cc: 63142 <at> debbugs.gnu.org
> Date: Fri, 28 Apr 2023 20:01:01 +0200
> 
> 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.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Sat, 29 Apr 2023 15:08:01 GMT) Full text and rfc822 format available.

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

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Yuri D'Elia <wavexx <at> thregr.org>, 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Sat, 29 Apr 2023 23:05:27 +0800
Eli Zaretskii <eliz <at> gnu.org> 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', in which case we should swap the two arguments to
`concat'?

-- 
Best,


RY

[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Sat, 29 Apr 2023 15:16:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ruijie Yu <ruijie <at> netyu.xyz>
Cc: wavexx <at> thregr.org, 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Sat, 29 Apr 2023 18:16:05 +0300
> From: Ruijie Yu <ruijie <at> netyu.xyz>
> Cc: Yuri D'Elia <wavexx <at> thregr.org>, 63142 <at> debbugs.gnu.org
> Date: Sat, 29 Apr 2023 23:05:27 +0800
> 
> 
> Eli Zaretskii <eliz <at> gnu.org> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Tue, 02 May 2023 09:37:02 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Ruijie Yu <ruijie <at> netyu.xyz>, 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Tue, 02 May 2023 11:35:13 +0200
On Sat, Apr 29 2023, Eli Zaretskii wrote:
>> > +	(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.

It's always a good idea to actually have the possibility to override
flags as an escape hatch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Tue, 02 May 2023 12:19:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: ruijie <at> netyu.xyz, 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Tue, 02 May 2023 15:18:56 +0300
> From: Yuri D'Elia <wavexx <at> thregr.org>
> Cc: Ruijie Yu <ruijie <at> netyu.xyz>, 63142 <at> debbugs.gnu.org
> Date: Tue, 02 May 2023 11:35:13 +0200
> 
> On Sat, Apr 29 2023, Eli Zaretskii wrote:
> >> > +	(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.
> 
> It's always a good idea to actually have the possibility to override
> flags as an escape hatch.

I agree.

What about the patch I proposed: does it give good results?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Tue, 02 May 2023 16:05:01 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ruijie <at> netyu.xyz, 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Tue, 02 May 2023 17:57:50 +0200
On Tue, May 02 2023, Eli Zaretskii wrote:
> What about the patch I proposed: does it give good results?

Working as intended.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 02 May 2023 17:49:01 GMT) Full text and rfc822 format available.

Notification sent to Yuri D'Elia <wavexx <at> thregr.org>:
bug acknowledged by developer. (Tue, 02 May 2023 17:49:01 GMT) Full text and rfc822 format available.

Message #46 received at 63142-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: ruijie <at> netyu.xyz, 63142-done <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Tue, 02 May 2023 20:48:47 +0300
> From: Yuri D'Elia <wavexx <at> thregr.org>
> Cc: ruijie <at> netyu.xyz, 63142 <at> debbugs.gnu.org
> Date: Tue, 02 May 2023 17:57:50 +0200
> 
> On Tue, May 02 2023, Eli Zaretskii wrote:
> > What about the patch I proposed: does it give good results?
> 
> Working as intended.

Thanks, so I've now installed it on the master branch, and I'm closing
this bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 11:06:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Yuri D'Elia <wavexx <at> thregr.org>, ruijie <at> netyu.xyz, 63142 <at> debbugs.gnu.org,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 5 May 2023 13:04:56 +0200
[Message part 1 (text/plain, inline)]
This change breaks tramp-tests on MacOS (and, I presume, BSDs) where `ls` accepts neither `--dired` nor `-N`. see appended test log.

In fact even ls-lisp doesn't seem to accept `-N`, or at least do anything with it. Not sure if that is a problem or not.

Should we reopen this bug or open a new one?

[tramp-tests.log (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 11:08:01 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: ruijie <at> netyu.xyz, Eli Zaretskii <eliz <at> gnu.org>, 63142 <at> debbugs.gnu.org,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 05 May 2023 13:06:21 +0200
On Fri, May 05 2023, Mattias Engdegård wrote:
> This change breaks tramp-tests on MacOS (and, I presume, BSDs) where
> `ls` accepts neither `--dired` nor `-N`. see appended test log.

Considering -N was added where --dired was already being used, I'm kind
of surprised?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 11:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: wavexx <at> thregr.org, ruijie <at> netyu.xyz, 63142 <at> debbugs.gnu.org,
 michael.albinus <at> gmx.de
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 05 May 2023 14:25:18 +0300
> From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
> Date: Fri, 5 May 2023 13:04:56 +0200
> Cc: Michael Albinus <michael.albinus <at> gmx.de>,
>  Yuri D'Elia <wavexx <at> thregr.org>,
>  ruijie <at> netyu.xyz,
>  63142 <at> debbugs.gnu.org
> 
> This change breaks tramp-tests on MacOS (and, I presume, BSDs) where `ls` accepts neither `--dired` nor `-N`. see appended test log.

Sorry, I don't understand.  The change added -N only where we
previously had --dired in the 'ls' switches.  Are you saying that we
somehow now pass "--dired -N" where previously we didn't pass "--dired"?

AFAIU, we should use --dired only when 'ls' supports it, and we now
use -N under the same conditions.  Is that not what happens?

> In fact even ls-lisp doesn't seem to accept `-N`, or at least do anything with it. Not sure if that is a problem or not.

This should not be used when ls-lisp is in use, see the line
emphasized below:

    (if (and
	 ;; Don't try to invoke `ls' if we are on DOS/Windows where
	 ;; ls-lisp emulation is used, except if they want to use `ls'
	 ;; as indicated by `ls-lisp-use-insert-directory-program'.
	 (not (and (featurep 'ls-lisp)  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		   (null ls-lisp-use-insert-directory-program)))
         ;; FIXME: Big ugly hack for Eshell's eshell-ls-use-in-dired.
         (not (bound-and-true-p eshell-ls-use-in-dired))
	 (or (file-remote-p dir)
             (if (eq dired-use-ls-dired 'unspecified)
		 ;; Check whether "ls --dired" gives exit code 0, and
		 ;; save the answer in `dired-use-ls-dired'.
		 (or (setq dired-use-ls-dired
			   (eq 0 (call-process insert-directory-program
                                               nil nil nil "--dired")))
		     (progn
		       (message "ls does not support --dired; \
see `dired-use-ls-dired' for more details.")
		       nil))
	       dired-use-ls-dired)))
        ;; Use -N with --dired, to countermand possible non-default
        ;; quoting style, in particular via the environment variable
        ;; QUOTING_STYLE.
	(setq switches (concat "--dired -N " switches)))

So once again, I don't understand what you are saying.  In any case,
I've just tried "C-x d" on MS-Windows, where ls-lisp is used by
default, and saw no problems.  What am I missing?

> Should we reopen this bug or open a new one?

I'd like Michael to chime in first.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 12:04:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: wavexx <at> thregr.org, ruijie <at> netyu.xyz,
 Mattias Engdegård <mattias.engdegard <at> gmail.com>,
 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 05 May 2023 14:03:13 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi,

>> This change breaks tramp-tests on MacOS (and, I presume, BSDs) where `ls` accepts neither `--dired` nor `-N`. see appended test log.
>
> AFAIU, we should use --dired only when 'ls' supports it, and we now
> use -N under the same conditions.  Is that not what happens?

This still happens.

>> Should we reopen this bug or open a new one?
>
> I'd like Michael to chime in first.

Well, we're speaking about tramp-sh-handle-insert-directory. This does
the following:

- Check, whether the remote ls command supports "--quoting-style=literal
  --show-control-chars" or "-w" (for *BSD). If yes, add this to SWITCHES.

- Check, whether the remote ls command supports "--dired". If not, remove
  "--dired" from SWITCHES.

It doesn't know anything about "-N". So I propose to remove "-N" from
switches unconditionally in Tramp.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 12:13:01 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: wavexx <at> thregr.org, ruijie <at> netyu.xyz, Eli Zaretskii <eliz <at> gnu.org>,
 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 5 May 2023 14:11:56 +0200
[Message part 1 (text/plain, inline)]
5 maj 2023 kl. 14.03 skrev Michael Albinus <michael.albinus <at> gmx.de>:

> It doesn't know anything about "-N". So I propose to remove "-N" from
> switches unconditionally in Tramp.

Yes, I found that out the hard way and can confirm that the patch below makes tramp-tests pass again.
Whether it's the right course of action, or requires more work elsewhere, I leave to you and Eli.

[bsd-ls-N.diff (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 13:28:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: wavexx <at> thregr.org, ruijie <at> netyu.xyz, mattias.engdegard <at> gmail.com,
 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 05 May 2023 16:28:07 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Mattias Engdegård <mattias.engdegard <at> gmail.com>,
>   wavexx <at> thregr.org,
>   ruijie <at> netyu.xyz,  63142 <at> debbugs.gnu.org
> Date: Fri, 05 May 2023 14:03:13 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Should we reopen this bug or open a new one?
> >
> > I'd like Michael to chime in first.
> 
> Well, we're speaking about tramp-sh-handle-insert-directory. This does
> the following:
> 
> - Check, whether the remote ls command supports "--quoting-style=literal
>   --show-control-chars" or "-w" (for *BSD). If yes, add this to SWITCHES.
> 
> - Check, whether the remote ls command supports "--dired". If not, remove
>   "--dired" from SWITCHES.
> 
> It doesn't know anything about "-N". So I propose to remove "-N" from
> switches unconditionally in Tramp.

SGTM, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 14:45:03 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: wavexx <at> thregr.org, ruijie <at> netyu.xyz, Eli Zaretskii <eliz <at> gnu.org>,
 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 05 May 2023 16:44:05 +0200
Mattias Engdegård <mattias.engdegard <at> gmail.com> writes:

Hi Mattias,

> Yes, I found that out the hard way and can confirm that the patch below makes tramp-tests pass again.
> Whether it's the right course of action, or requires more work elsewhere, I leave to you and Eli.

Thanks. LGTM, so you might push it.

It doesn't handle the case that somebody uses switches like "-alN". But
this would be intentional by the user, and we don't need to care about.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63142; Package emacs. (Fri, 05 May 2023 17:28:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: wavexx <at> thregr.org, ruijie <at> netyu.xyz, Eli Zaretskii <eliz <at> gnu.org>,
 63142 <at> debbugs.gnu.org
Subject: Re: bug#63142: 30.0.50; QUOTING_STYLE can break dired
Date: Fri, 5 May 2023 19:26:51 +0200
5 maj 2023 kl. 16.44 skrev Michael Albinus <michael.albinus <at> gmx.de>:

> Thanks. LGTM, so you might push it.

Thank you, now on master.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 03 Jun 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 328 days ago.

Previous Next


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