unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [Small change] Issue with dired-do-async-shell-command and certain shells
@ 2023-05-18 18:12 Lycomedes 1814
  2023-05-18 18:40 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-18 18:12 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 659 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-18 18:12 [Small change] Issue with dired-do-async-shell-command and certain shells Lycomedes 1814
@ 2023-05-18 18:40 ` Eli Zaretskii
  2023-05-18 21:28   ` Lycomedes 1814
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2023-05-18 18:40 UTC (permalink / raw)
  To: Lycomedes 1814; +Cc: emacs-devel

> From: Lycomedes 1814 <lycomedes1814@yandex.com>
> Date: Thu, 18 May 2023 20:12:45 +0200
> 
> 1. Use fish as your system shell.
> 2. Use dired-do-async-shell-command on any file, and type e.g. mpv.
>  
> Fish interprets "&wait" as part of the file name, so mpv returns: "[file] Cannot open file '027.wav&wait':
> No such file or directory."
>  
> Solution:
>  
> In the function dired-shell-stuff-it, replace "&wait" with "& ".  Then fish interprets the command
> correctly.

But the "wait" part is there for a reason, so simply removing it is
hardly TRT.

What if we use " & wait" instead, i.e. add a space between & and
"wait"? does the command then work correctly with fish?



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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-18 18:40 ` Eli Zaretskii
@ 2023-05-18 21:28   ` Lycomedes 1814
  2023-05-18 23:22     ` Lycomedes 1814
  0 siblings, 1 reply; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-18 21:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 1145 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-18 21:28   ` Lycomedes 1814
@ 2023-05-18 23:22     ` Lycomedes 1814
  2023-05-19  6:29       ` Eli Zaretskii
  2023-05-19  7:23       ` Po Lu
  0 siblings, 2 replies; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-18 23:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 1459 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-18 23:22     ` Lycomedes 1814
@ 2023-05-19  6:29       ` Eli Zaretskii
  2023-05-19 14:54         ` Lycomedes 1814
  2023-05-19  7:23       ` Po Lu
  1 sibling, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2023-05-19  6:29 UTC (permalink / raw)
  To: Lycomedes 1814; +Cc: emacs-devel

> From: Lycomedes 1814 <lycomedes1814@yandex.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Fri, 19 May 2023 01:22:04 +0200
> 
> Clarification: it works when "&wait" is changed to "& wait" and the two instances of "&" are changed to
> "& ".

To which two instances of "&" are you alluding here?  Please show the
places in the code where you think this replacement should be done.



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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-18 23:22     ` Lycomedes 1814
  2023-05-19  6:29       ` Eli Zaretskii
@ 2023-05-19  7:23       ` Po Lu
  2023-05-19 15:01         ` Lycomedes 1814
  1 sibling, 1 reply; 14+ messages in thread
From: Po Lu @ 2023-05-19  7:23 UTC (permalink / raw)
  To: Lycomedes 1814; +Cc: Eli Zaretskii, emacs-devel@gnu.org

Lycomedes 1814 <lycomedes1814@yandex.com> writes:

> Clarification: it works when "&wait" is changed to "& wait" and the two instances of "&" are changed to "& ".
>  
> 18.05.2023, 23:28, "Lycomedes 1814" <lycomedes1814@yandex.com>:
>
>  Indeed, "& wait" works with fish.  For the function to work with multiple files selected, "&" must be changed to "& ".
>   
>  18.05.2023, 20:40, "Eli Zaretskii" <eliz@gnu.org>:
>
>   From: Lycomedes 1814 <lycomedes1814@yandex.com>
>   Date: Thu, 18 May 2023 20:12:45 +0200
>   
>   1. Use fish as your system shell.
>   2. Use dired-do-async-shell-command on any file, and type e.g. mpv.
>    
>   Fish interprets "&wait" as part of the file name, so mpv returns: "[file] Cannot open file '027.wav&wait':
>   No such file or directory."
>    
>   Solution:
>    
>   In the function dired-shell-stuff-it, replace "&wait" with "& ". Then fish interprets the command
>   correctly.
>
>  But the "wait" part is there for a reason, so simply removing it is
>  hardly TRT.
>
>  What if we use " & wait" instead, i.e. add a space between & and
>  "wait"? does the command then work correctly with fish?

Is fish a Bourne shell?



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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19  6:29       ` Eli Zaretskii
@ 2023-05-19 14:54         ` Lycomedes 1814
  2023-05-19 15:51           ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-19 14:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 3947 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19  7:23       ` Po Lu
@ 2023-05-19 15:01         ` Lycomedes 1814
  0 siblings, 0 replies; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-19 15:01 UTC (permalink / raw)
  To: Po Lu; +Cc: Eli Zaretskii, emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 1867 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19 14:54         ` Lycomedes 1814
@ 2023-05-19 15:51           ` Eli Zaretskii
  2023-05-19 17:15             ` Lycomedes 1814
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2023-05-19 15:51 UTC (permalink / raw)
  To: Lycomedes 1814; +Cc: emacs-devel

> From: Lycomedes 1814 <lycomedes1814@yandex.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Fri, 19 May 2023 16:54:44 +0200
> 
> Sure, here's a diff:

Thanks.

> diff -u /home/jal/Code/emacs-patch/dired-aux.el /home/jal/Code/emacs-patch/dired-aux-new.el
> --- /home/jal/Code/emacs-patch/dired-aux.el    2023-05-19 14:45:53.360586128 +0000
> +++ /home/jal/Code/emacs-patch/dired-aux-new.el    2023-05-19 14:46:39.880476896 +0000
> @@ -945,7 +945,7 @@
>           ;; "&" instead.
>           (cmd-sep (if (and (or (not w32-shell) file-remote)
>                 (not parallel-in-background))
> -              ";" "&"))
> +              ";" "& "))

Here "&" is used only on MS-Windows, where I don't expect to see fish
as the shell.  Are you sure this is relevant to the problem?

> @@ -969,7 +969,7 @@
>                 ;; Add 'wait' to force those POSIX shells to wait until
>                 ;; all commands finish.
>                 (or (and parallel-in-background (not w32-shell)
> -                        "&wait")
> +                        "& wait")

This is the one we've been talking about from the beginning.

> @@ -977,7 +977,7 @@
>           (when (cdr file-list)
>             (setq files (concat dired-mark-prefix files dired-mark-postfix)))
>           (funcall stuff-it files))))
> -     (or (and in-background "&") ""))))
> +     (or (and in-background "& ") ""))))

This AFAIU is just appended to the end of the command, with nothing
after it.  Are you sure this one is needed?  If so, can you describe a
reproduction recipe where "&" here causes a problem and "& " doesn't?



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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19 15:51           ` Eli Zaretskii
@ 2023-05-19 17:15             ` Lycomedes 1814
  2023-05-19 18:26               ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-19 17:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 3840 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19 17:15             ` Lycomedes 1814
@ 2023-05-19 18:26               ` Eli Zaretskii
  2023-05-19 19:01                 ` Lycomedes 1814
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2023-05-19 18:26 UTC (permalink / raw)
  To: Lycomedes 1814; +Cc: emacs-devel

> From: Lycomedes 1814 <lycomedes1814@yandex.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Fri, 19 May 2023 19:15:43 +0200
> 
> It's needed for multiple files selected (without the * to pass them all as args to one instance of the
> command), to avoid the following:

Which one is needed for this?  I pointed out two instances of "&",
which one is needed to avoid the problem you describe?  One of the two
instances are for MS-Windows, are you sure it is needed?



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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19 18:26               ` Eli Zaretskii
@ 2023-05-19 19:01                 ` Lycomedes 1814
  2023-05-19 19:11                   ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Lycomedes 1814 @ 2023-05-19 19:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/html, Size: 1005 bytes --]

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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19 19:01                 ` Lycomedes 1814
@ 2023-05-19 19:11                   ` Eli Zaretskii
  2023-05-20 14:29                     ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2023-05-19 19:11 UTC (permalink / raw)
  To: Lycomedes 1814; +Cc: emacs-devel

> From: Lycomedes 1814 <lycomedes1814@yandex.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Fri, 19 May 2023 21:01:45 +0200
> 
> From my testing it does seem to be the first one, the one that checks for w32.

I cannot understand how that could be.

> Is there a problem with changing both?

Yes, because using ";" to separate commands on MS-Windows doesn't
work, so we use "&".



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

* Re: [Small change] Issue with dired-do-async-shell-command and certain shells
  2023-05-19 19:11                   ` Eli Zaretskii
@ 2023-05-20 14:29                     ` Eli Zaretskii
  0 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2023-05-20 14:29 UTC (permalink / raw)
  To: lycomedes1814; +Cc: emacs-devel

> Date: Fri, 19 May 2023 22:11:36 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> > From: Lycomedes 1814 <lycomedes1814@yandex.com>
> > Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> > Date: Fri, 19 May 2023 21:01:45 +0200
> > 
> > From my testing it does seem to be the first one, the one that checks for w32.
> 
> I cannot understand how that could be.
> 
> > Is there a problem with changing both?
> 
> Yes, because using ";" to separate commands on MS-Windows doesn't
> work, so we use "&".

I ended up adding the blanks in all of those places, and installed the
changes on the master branch.

Thanks.



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

end of thread, other threads:[~2023-05-20 14:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 18:12 [Small change] Issue with dired-do-async-shell-command and certain shells Lycomedes 1814
2023-05-18 18:40 ` Eli Zaretskii
2023-05-18 21:28   ` Lycomedes 1814
2023-05-18 23:22     ` Lycomedes 1814
2023-05-19  6:29       ` Eli Zaretskii
2023-05-19 14:54         ` Lycomedes 1814
2023-05-19 15:51           ` Eli Zaretskii
2023-05-19 17:15             ` Lycomedes 1814
2023-05-19 18:26               ` Eli Zaretskii
2023-05-19 19:01                 ` Lycomedes 1814
2023-05-19 19:11                   ` Eli Zaretskii
2023-05-20 14:29                     ` Eli Zaretskii
2023-05-19  7:23       ` Po Lu
2023-05-19 15:01         ` Lycomedes 1814

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).