unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
@ 2017-09-23 11:18 積丹尼 Dan Jacobson
  2017-09-23 13:59 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-09-23 11:18 UTC (permalink / raw)
  To: 28569

User sees arguments with embedded spaces on
(info "(coreutils) Formatting file timestamps")
and tries one.

He types C-u s which runs the command dired-sort-toggle-or-edit
and at the prompt gives:

ls switches (must contain -l): -olt --time-style='+%Y-%m-%d %H:%M:%S.%N %z'

Alas, it turns out if the string contains any kind of quote mark, the
entire dired screen will go blank, with the error

insert-directory: Listing directory failed but ‘access-file’ worked





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
  2017-09-23 11:18 bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks 積丹尼 Dan Jacobson
@ 2017-09-23 13:59 ` Eli Zaretskii
  2017-09-23 14:25   ` Eli Zaretskii
  2017-09-23 14:17 ` 積丹尼 Dan Jacobson
  2017-09-23 14:36 ` 積丹尼 Dan Jacobson
  2 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2017-09-23 13:59 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 28569

> From: 積丹尼 Dan Jacobson
> 	<jidanni@jidanni.org>
> Date: Sat, 23 Sep 2017 19:18:29 +0800
> 
> User sees arguments with embedded spaces on
> (info "(coreutils) Formatting file timestamps")
> and tries one.
> 
> He types C-u s which runs the command dired-sort-toggle-or-edit
> and at the prompt gives:
> 
> ls switches (must contain -l): -olt --time-style='+%Y-%m-%d %H:%M:%S.%N %z'
> 
> Alas, it turns out if the string contains any kind of quote mark, the
> entire dired screen will go blank, with the error
> 
> insert-directory: Listing directory failed but ‘access-file’ worked

Did you read the doc string of dired-listing-switches?  It explains
how to specify long options that include whitespace.  (Hint: Dired is
not a shell, so shell-style quoting is not necessarily appropriate.)

Oh, I see that Emacs 25.2 doesn't yet have that bit in the doc string.
Well, but what will become Emacs 26.1 does.  Here's that text, for
your convenience:

  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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
  2017-09-23 11:18 bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks 積丹尼 Dan Jacobson
  2017-09-23 13:59 ` Eli Zaretskii
@ 2017-09-23 14:17 ` 積丹尼 Dan Jacobson
  2017-09-23 14:36 ` 積丹尼 Dan Jacobson
  2 siblings, 0 replies; 7+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-09-23 14:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 28569

Maybe the docstring should remind that --option=\"value with spaces\"
won't work.

EZ>   Options that include embedded whitespace must be quoted
EZ>   like this: \"--option=value with spaces\"; you can use
EZ>   ‘combine-and-quote-strings’ to produce the correct quoting of
EZ>   each option.

Actually perhaps just parse the line like the shell does... And then
both would work.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
  2017-09-23 13:59 ` Eli Zaretskii
@ 2017-09-23 14:25   ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2017-09-23 14:25 UTC (permalink / raw)
  To: jidanni; +Cc: 28569

> Date: Sat, 23 Sep 2017 16:59:10 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 28569@debbugs.gnu.org
> 
>   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.

Sorry, that should be

   "--option=value with spaces"

without the backslashes.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
  2017-09-23 11:18 bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks 積丹尼 Dan Jacobson
  2017-09-23 13:59 ` Eli Zaretskii
  2017-09-23 14:17 ` 積丹尼 Dan Jacobson
@ 2017-09-23 14:36 ` 積丹尼 Dan Jacobson
  2017-09-23 14:58   ` Eli Zaretskii
  2 siblings, 1 reply; 7+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-09-23 14:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 28569

I think the user should just be able to enter things to C-u s just like
he does in the shell. And C-u s should parse the arguments for him.
I don't see what the advantage of having him enter
"--option=value with spaces"
instead of
--option="value with spaces" is.
Both should work in my opinion, and whatever dirty work of parsing
should be done behind the scenes by the program.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
  2017-09-23 14:36 ` 積丹尼 Dan Jacobson
@ 2017-09-23 14:58   ` Eli Zaretskii
  2021-11-30 15:08     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2017-09-23 14:58 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 28569

> From: 積丹尼 Dan Jacobson <jidanni@jidanni.org>
> Cc: 28569@debbugs.gnu.org
> Date: Sat, 23 Sep 2017 22:36:31 +0800
> 
> I don't see what the advantage of having him enter
> "--option=value with spaces"
> instead of
> --option="value with spaces" is.

Dired is not a shell, so what works and/or is equivalent for a shell
doesn't need to work the same in Dired.  Just follow the docs.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks
  2017-09-23 14:58   ` Eli Zaretskii
@ 2021-11-30 15:08     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-30 15:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 積丹尼 Dan Jacobson, 28569

Eli Zaretskii <eliz@gnu.org> writes:

>> I don't see what the advantage of having him enter
>> "--option=value with spaces"
>> instead of
>> --option="value with spaces" is.
>
> Dired is not a shell, so what works and/or is equivalent for a shell
> doesn't need to work the same in Dired.  Just follow the docs.

So there doesn't seem to be anything to fix here, and I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-30 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-23 11:18 bug#28569: 25.2; dired-sort-toggle-or-edit vs. quote marks 積丹尼 Dan Jacobson
2017-09-23 13:59 ` Eli Zaretskii
2017-09-23 14:25   ` Eli Zaretskii
2017-09-23 14:17 ` 積丹尼 Dan Jacobson
2017-09-23 14:36 ` 積丹尼 Dan Jacobson
2017-09-23 14:58   ` Eli Zaretskii
2021-11-30 15:08     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).