From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2012 10:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10598@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.132748668426268 (code B ref -1); Wed, 25 Jan 2012 10:19:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jan 2012 10:18:04 +0000 Received: from localhost ([127.0.0.1]:42623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RpzvX-0006pd-P7 for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:18:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:60743) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RpzvW-0006pA-7U for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:18:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpzv0-0007Z8-MK for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:17:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:44092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpzv0-0007Z4-Kv for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:17:30 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpzuv-0002hN-6k for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpzuq-0007YY-W5 for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:25 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:34108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpzuq-0007YU-Ua for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:20 -0500 Received: from u010774.lc.ehu.es ([158.227.8.163]:53506 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Rpzuq-0002Yr-JY for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:20 -0500 Date: Wed, 25 Jan 2012 04:17:16 -0600 Message-Id: <87liow9jdf.fsf@niu.edu> From: "Roland Winkler" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Within dired, I want to run a shell command asynchronously on multiple files individually. Say, most specifically I tried to watch the postscript files foo.ps and bar.ps with gv. So I mark foo.ps and bar.ps in the dired buffer and hit & gv ? In the buffer *Async Shell Command* this gives me the error message /bin/bash: -c: line 0: syntax error near unexpected token `;' /bin/bash: -c: line 0: `gv foo.ps &;gv bar.ps' I get the same error message with the command dired-do-shell-command using ! gv ? & I am not the most experienced bash expert. But it seems that bash doesn't like the combination `&;'. Note also that there is no `&' for `gv bar.ps'. In a tty $ gv foo.ps & gv bar.ps & works fine for me (giving me what I expect to get within dired). Am I misunderstanding the docstrings of dired-do-shell-command and dired-do-async-shell-command (which are a bit confusing for me concerning how to run a shell command on multiple files) or is there a bug in the code? In GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2011-12-14 on regnitz Windowing system distributor `The X.Org Foundation', version 11.0.10706000 From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2012 11:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.132749026131486 (code B ref 10598); Wed, 25 Jan 2012 11:18:02 +0000 Received: (at 10598) by debbugs.gnu.org; 25 Jan 2012 11:17:41 +0000 Received: from localhost ([127.0.0.1]:42701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rq0rE-0008Bk-Mi for submit@debbugs.gnu.org; Wed, 25 Jan 2012 06:17:40 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:49077 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rq0r7-0008BU-PB for 10598@debbugs.gnu.org; Wed, 25 Jan 2012 06:17:39 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 7A3C8451C7EA; Wed, 25 Jan 2012 03:16:02 -0800 (PST) From: Juri Linkov Organization: JURTA References: <87liow9jdf.fsf@niu.edu> Date: Wed, 25 Jan 2012 13:14:17 +0200 In-Reply-To: <87liow9jdf.fsf@niu.edu> (Roland Winkler's message of "Wed, 25 Jan 2012 04:17:16 -0600") Message-ID: <87obtsqbiw.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Am I misunderstanding the docstrings of dired-do-shell-command and > dired-do-async-shell-command (which are a bit confusing for me > concerning how to run a shell command on multiple files) or is there > a bug in the code? I think `dired-shell-stuff-it' should be improved to translate `gv foo.ps&;gv bar.ps&' into `gv foo.ps&gv bar.ps&' or into `gv foo.ps;gv bar.ps&' depending on whether you want to run asynchronously both at the same time or sequentially (perhaps a new option should define that). From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2012 11:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.13274920862153 (code B ref 10598); Wed, 25 Jan 2012 11:49:02 +0000 Received: (at 10598) by debbugs.gnu.org; 25 Jan 2012 11:48:06 +0000 Received: from localhost ([127.0.0.1]:42803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rq1Kf-0000Yf-JB for submit@debbugs.gnu.org; Wed, 25 Jan 2012 06:48:05 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:35324 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rq1Kd-0000YY-CQ for 10598@debbugs.gnu.org; Wed, 25 Jan 2012 06:48:04 -0500 Received: from u010774.lc.ehu.es ([158.227.8.163]:53626 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Rq1KD-0005wG-4T; Wed, 25 Jan 2012 06:47:37 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20255.60373.371008.208639@gargle.gargle.HOWL> Date: Wed, 25 Jan 2012 05:47:33 -0600 From: "Roland Winkler" In-Reply-To: <87obtsqbiw.fsf@mail.jurta.org> References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> X-Mailer: VM 8.2 trial under 24.0.92.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On Wed Jan 25 2012 Juri Linkov wrote: > I think `dired-shell-stuff-it' should be improved to translate > `gv foo.ps&;gv bar.ps&' into `gv foo.ps&gv bar.ps&' or into > `gv foo.ps;gv bar.ps&' depending on whether you want to run > asynchronously both at the same time or sequentially > (perhaps a new option should define that). Good point! In my case I wanted to run the commands asynchronously at the same time. Others might want to run the command asynchronously, but sequentially. Roland From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually References: <87liow9jdf.fsf@niu.edu> In-Reply-To: <87liow9jdf.fsf@niu.edu> Resent-From: =?UTF-8?Q?J=C3=A9r=C3=A9my?= Compostella Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2012 22:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.13275317765671 (code B ref 10598); Wed, 25 Jan 2012 22:50:02 +0000 Received: (at 10598) by debbugs.gnu.org; 25 Jan 2012 22:49:36 +0000 Received: from localhost ([127.0.0.1]:44064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqBep-0001TN-Ru for submit@debbugs.gnu.org; Wed, 25 Jan 2012 17:49:36 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:43221) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqBeN-0001SK-Rb for 10598@debbugs.gnu.org; Wed, 25 Jan 2012 17:49:08 -0500 Received: by werm10 with SMTP id m10so310501wer.3 for <10598@debbugs.gnu.org>; Wed, 25 Jan 2012 14:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; bh=iRkBgEzS4Cl3yLCEEyq88vCWF6w/uRFLWCnlOGxP4Fg=; b=YVIM3uoCpEZcs1+Vo/Zl3ElW6ZZnvblr/bJC+RWgBqjmjtNByyPk5g1L+ATBQ/qXsK D9dCGW+Atgsd1JouO3IIU0Ms6deGrc6yPrxb5WYkzGff6GA7PCWv/lTfQgzlPiLO+9km /2rCgSf3LZYUROaIp8I3YorBEZZrlkdGg+5kw= Received: by 10.180.103.97 with SMTP id fv1mr31646440wib.17.1327531713720; Wed, 25 Jan 2012 14:48:33 -0800 (PST) Received: from Apollo.jerryland.fr ([85.69.251.50]) by mx.google.com with ESMTPS id di5sm6270422wib.3.2012.01.25.14.48.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jan 2012 14:48:33 -0800 (PST) From: =?UTF-8?Q?J=C3=A9r=C3=A9my?= Compostella Date: Wed, 25 Jan 2012 23:48:51 +0100 Message-ID: <87hazjtn3g.fsf@Apollo.jerryland.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.6 (--) X-Mailman-Approved-At: Wed, 25 Jan 2012 17:49:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, This bug was really annoying me tonight so I wrote the attached patch which fix it by translating `gv foo.ps&;gv bar.ps&' to `gv foo.ps&gv bar.ps&'. I do agree it should be better to provide a way to choice between the sequential or parallel solution but I have no idea how to implement it in a clean fashion for now. Anyway, the current behavior looks buggy and I propose to merge the attached patch in a first time in order to have a acceptable behavior that is far better than an error. Best regards, J=C3=A9r=C3=A9my --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-dired-do-async-shell-command-on-multiple-files-i.patch Content-Description: Fix dired-do-async-shell-command on multiple files individually (bug#10598) patch >From aefc85c364f6e51676ffc9dc44deb9a4d43a128c Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Wed, 25 Jan 2012 23:38:54 +0100 Subject: [PATCH] Fix dired-do-async-shell-command on multiple files individually (bug#10598) The `dired-shell-stuff-it' should not insert the ";" shell command separator when called with a command argument ending with the "&" character. Signed-off-by: Jeremy Compostella --- lisp/dired-aux.el | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 2d05be3..74f0de9 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -659,7 +659,8 @@ can be produced by `dired-get-marked-files', for example." retval)) (lambda (x) (concat command dired-mark-separator x))))) (if on-each - (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") + (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) + (if (string-match "[ \t]*&[ \t]*\\'" command) "" ";")) (let ((files (mapconcat 'shell-quote-argument file-list dired-mark-separator))) (if (> (length file-list) 1) -- 1.7.2.5 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 05:04:28 2012 Received: (at control) by debbugs.gnu.org; 12 Jul 2012 09:04:28 +0000 Received: from localhost ([127.0.0.1]:35053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFK0-0003ow-Hg for submit@debbugs.gnu.org; Thu, 12 Jul 2012 05:04:28 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:33663 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFJz-0003oq-60 for control@debbugs.gnu.org; Thu, 12 Jul 2012 05:04:27 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id DC57D451CB17 for ; Thu, 12 Jul 2012 01:58:52 -0700 (PDT) From: Juri Linkov To: control@debbugs.gnu.org Subject: Control message Organization: JURTA Date: Thu, 12 Jul 2012 11:58:40 +0300 Message-ID: <87sjcx73un.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) severity 10598 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 05:05:56 2012 Received: (at control) by debbugs.gnu.org; 12 Jul 2012 09:05:56 +0000 Received: from localhost ([127.0.0.1]:35062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFLP-0003rH-Ss for submit@debbugs.gnu.org; Thu, 12 Jul 2012 05:05:56 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:34656 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFLN-0003rA-QN for control@debbugs.gnu.org; Thu, 12 Jul 2012 05:05:54 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id DF580451CB17 for ; Thu, 12 Jul 2012 02:00:21 -0700 (PDT) From: Juri Linkov To: control@debbugs.gnu.org Subject: Control message Organization: JURTA Date: Thu, 12 Jul 2012 11:59:54 +0300 Message-ID: <87ipdt73sl.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) forcemerge 11815 10598 thanks From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jul 2012 09:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134208407015035 (code B ref 10598); Thu, 12 Jul 2012 09:08:02 +0000 Received: (at 10598) by debbugs.gnu.org; 12 Jul 2012 09:07:50 +0000 Received: from localhost ([127.0.0.1]:35072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFNF-0003uQ-Pf for submit@debbugs.gnu.org; Thu, 12 Jul 2012 05:07:50 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:36074 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFND-0003uJ-JK for 10598@debbugs.gnu.org; Thu, 12 Jul 2012 05:07:48 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 4526E451CB17; Thu, 12 Jul 2012 02:02:15 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> Date: Thu, 12 Jul 2012 12:01:30 +0300 In-Reply-To: <20255.60373.371008.208639@gargle.gargle.HOWL> (Roland Winkler's message of "Wed, 25 Jan 2012 05:47:33 -0600") Message-ID: <87394x8im1.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> I think `dired-shell-stuff-it' should be improved to translate >> `gv foo.ps&;gv bar.ps&' into `gv foo.ps&gv bar.ps&' or into >> `gv foo.ps;gv bar.ps&' depending on whether you want to run >> asynchronously both at the same time or sequentially >> (perhaps a new option should define that). > > Good point! In my case I wanted to run the commands asynchronously > at the same time. Others might want to run the command > asynchronously, but sequentially. This can be fixed with the following patch: === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-04-17 01:52:00 +0000 +++ lisp/dired-aux.el 2012-07-12 08:51:48 +0000 @@ -542,12 +542,25 @@ (defun dired-read-shell-command (prompt (dired-mark-pop-up nil 'shell files 'read-shell-command prompt nil nil)))) +(defvar dired-async-each t + "How to run `dired-do-async-shell-command' on multiple files individually. +When non-nil, run asynchronous commands on each file parallelly. +In shell syntax this means separating the individual commands with `&'. +When nil, run commands in the background on each file sequentially +waiting for each command to terminate before running the next command. +In shell syntax this means separating the individual commands with `;'.") + ;;;###autoload (defun dired-do-async-shell-command (command &optional arg file-list) "Run a shell command COMMAND on the marked files asynchronously. -Like `dired-do-shell-command' but if COMMAND doesn't end in ampersand, -adds `* &' surrounded by whitespace and executes the command asynchronously. +Like `dired-do-shell-command' but adds `&' at the end of COMMAND +to execute it asynchronously. + +When operating on multiple files, the variable `dired-async-each' +defines whether to run asynchronous commands on each file parallelly +or sequentially. + The output appears in the buffer `*Async Shell Command*'." (interactive (let ((files (dired-get-marked-files t current-prefix-arg))) @@ -556,14 +569,10 @@ (defun dired-do-async-shell-command (com (dired-read-shell-command "& on %s: " current-prefix-arg files) current-prefix-arg files))) - (unless (string-match "[*?][ \t]*\\'" command) - (setq command (concat command " *"))) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) (dired-do-shell-command command arg file-list)) -;; The in-background argument is only needed in Emacs 18 where -;; shell-command doesn't understand an appended ampersand `&'. ;;;###autoload (defun dired-do-shell-command (command &optional arg file-list) "Run a shell command COMMAND on the marked files. @@ -655,7 +661,11 @@ (defun dired-shell-stuff-it (command fil ;; Might be redefined for smarter things and could then use RAW-ARG ;; (coming from interactive P and currently ignored) to decide what to do. ;; Smart would be a way to access basename or extension of file names. - (let ((stuff-it + (let* ((in-background (string-match "[ \t]*&[ \t]*\\'" command)) + (command (if in-background + (substring command 0 (match-beginning 0)) + command)) + (stuff-it (if (or (string-match dired-star-subst-regexp command) (string-match dired-quark-subst-regexp command)) (lambda (x) @@ -665,13 +675,16 @@ (defun dired-shell-stuff-it (command fil (setq retval (replace-match x t t retval 2))) retval)) (lambda (x) (concat command dired-mark-separator x))))) + (concat (if on-each - (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") + (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) + (if (and in-background dired-async-each) "&" ";")) (let ((files (mapconcat 'shell-quote-argument file-list dired-mark-separator))) (if (> (length file-list) 1) (setq files (concat dired-mark-prefix files dired-mark-postfix))) - (funcall stuff-it files))))) + (funcall stuff-it files))) + (if in-background "&" "")))) ;; This is an extra function so that it can be redefined by ange-ftp. ;;;###autoload From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jul 2012 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134208912625564 (code B ref 10598); Thu, 12 Jul 2012 10:33:02 +0000 Received: (at 10598) by debbugs.gnu.org; 12 Jul 2012 10:32:06 +0000 Received: from localhost ([127.0.0.1]:35227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpGgk-0006eE-Sj for submit@debbugs.gnu.org; Thu, 12 Jul 2012 06:32:05 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:34782) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpGgi-0006dp-KL for 10598@debbugs.gnu.org; Thu, 12 Jul 2012 06:32:01 -0400 Received: from lukas.physics.niu.edu ([131.156.85.221]:51992) by fencepost.gnu.org with esmtpa (Exim 4.71) (envelope-from ) id 1SpGbM-0006od-Kd; Thu, 12 Jul 2012 06:26:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20478.42579.593253.620476@lukas.physics.niu.edu> Date: Thu, 12 Jul 2012 05:26:27 -0500 From: "Roland Winkler" In-Reply-To: <87394x8im1.fsf@mail.jurta.org> References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> X-Mailer: VM 8.2 trial under 24.1.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On Thu Jul 12 2012 Juri Linkov wrote: > This can be fixed with the following patch: Thanks for looking into this. > +(defvar dired-async-each t Should this possibly be defcustom? I'd consider this a user option. Roland From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jul 2012 08:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134216871221537 (code B ref 10598); Fri, 13 Jul 2012 08:39:02 +0000 Received: (at 10598) by debbugs.gnu.org; 13 Jul 2012 08:38:32 +0000 Received: from localhost ([127.0.0.1]:38366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpbOS-0005bJ-91 for submit@debbugs.gnu.org; Fri, 13 Jul 2012 04:38:32 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:55856 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpbOP-0005bA-Up for 10598@debbugs.gnu.org; Fri, 13 Jul 2012 04:38:30 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 57A82451CB15; Fri, 13 Jul 2012 01:32:50 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> Date: Fri, 13 Jul 2012 11:30:10 +0300 In-Reply-To: <20478.42579.593253.620476@lukas.physics.niu.edu> (Roland Winkler's message of "Thu, 12 Jul 2012 05:26:27 -0500") Message-ID: <871ukg9i6m.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> +(defvar dired-async-each t > > Should this possibly be defcustom? I'd consider this a user option. I can't imagine anyone wanting to customize it on a permanent basis because the desirable behavior depends on the type of executed command: non-interactive programs are better to run sequentially, but programs with GUI are better to run in parallel. Ideally this preference should be expressed by syntax on the command line like using special symbols `*' and `?', but at the moment I have no idea for such a syntax. At least with a variable the users can do something like (define-key dired-mode-map ";" (lambda () (interactive) (let ((dired-async-each nil)) (call-interactively 'dired-do-async-shell-command)))) From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jul 2012 09:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134217206526475 (code B ref 10598); Fri, 13 Jul 2012 09:35:01 +0000 Received: (at 10598) by debbugs.gnu.org; 13 Jul 2012 09:34:25 +0000 Received: from localhost ([127.0.0.1]:38471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpcGX-0006sy-CF for submit@debbugs.gnu.org; Fri, 13 Jul 2012 05:34:25 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:36315) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpcGV-0006ss-MH for 10598@debbugs.gnu.org; Fri, 13 Jul 2012 05:34:24 -0400 Received: from pchdb00005.uni-regensburg.de ([132.199.129.10]:40211 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SpcB4-0000ni-Bi; Fri, 13 Jul 2012 05:28:46 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20479.59979.797807.988643@gargle.gargle.HOWL> Date: Fri, 13 Jul 2012 04:28:43 -0500 From: "Roland Winkler" In-Reply-To: <871ukg9i6m.fsf@mail.jurta.org> References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> X-Mailer: VM 8.2 trial under 24.1.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On Fri Jul 13 2012 Juri Linkov wrote: > At least with a variable the users can do something like > > (define-key dired-mode-map ";" > (lambda () > (interactive) > (let ((dired-async-each nil)) > (call-interactively 'dired-do-async-shell-command)))) Would it make sense to provide such a command for everyone? If dired-async-each is not even intended to be customizable, I cannot think of too many other options to use this variable in a meaningful way. Anyway, in real life I expect that according to Murphy's Law whatever customization a user chooses for this variable, next time he or she needs to run dired-do-async-shell-command, the customized value will be the wrong one. From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jul 2012 09:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134225950530315 (code B ref 10598); Sat, 14 Jul 2012 09:52:02 +0000 Received: (at 10598) by debbugs.gnu.org; 14 Jul 2012 09:51:45 +0000 Received: from localhost ([127.0.0.1]:40295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Spz0r-0007su-Lb for submit@debbugs.gnu.org; Sat, 14 Jul 2012 05:51:45 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:51036 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Spz0p-0007sc-33 for 10598@debbugs.gnu.org; Sat, 14 Jul 2012 05:51:44 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 8B46E451CB51; Sat, 14 Jul 2012 02:45:59 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> <20479.59979.797807.988643@gargle.gargle.HOWL> Date: Sat, 14 Jul 2012 12:31:37 +0300 In-Reply-To: <20479.59979.797807.988643@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 13 Jul 2012 04:28:43 -0500") Message-ID: <878vem8z9i.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Would it make sense to provide such a command for everyone? If > dired-async-each is not even intended to be customizable, I cannot > think of too many other options to use this variable in a meaningful > way. Anyway, in real life I expect that according to Murphy's Law > whatever customization a user chooses for this variable, next time > he or she needs to run dired-do-async-shell-command, the customized > value will be the wrong one. A good UI to select the desired behavior before the command invocation is to use a prefix argument. A comment in `dired-shell-stuff-it' says: ;; Might be redefined for smarter things and could then use RAW-ARG ;; (coming from interactive P and currently ignored) to decide what to do. ;; Smart would be a way to access basename or extension of file names. I don't know how it was intended to be implemented a smart way, but maybe the same could be used to specify how to run dired async commands? From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Jul 2012 07:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134233906610108 (code B ref 10598); Sun, 15 Jul 2012 07:58:02 +0000 Received: (at 10598) by debbugs.gnu.org; 15 Jul 2012 07:57:46 +0000 Received: from localhost ([127.0.0.1]:41678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqJi5-0002cy-9L for submit@debbugs.gnu.org; Sun, 15 Jul 2012 03:57:46 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:44502) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqJi3-0002cr-Du for 10598@debbugs.gnu.org; Sun, 15 Jul 2012 03:57:44 -0400 Received: from pchdb00005.uni-regensburg.de ([132.199.129.10]:41499 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SqJcQ-0008HF-Uz; Sun, 15 Jul 2012 03:51:55 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20482.30360.86756.671195@gargle.gargle.HOWL> Date: Sun, 15 Jul 2012 02:51:52 -0500 From: "Roland Winkler" In-Reply-To: <878vem8z9i.fsf@mail.jurta.org> References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> <20479.59979.797807.988643@gargle.gargle.HOWL> <878vem8z9i.fsf@mail.jurta.org> X-Mailer: VM 8.2 trial under 24.1.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) On Sat Jul 14 2012 Juri Linkov wrote: > A good UI to select the desired behavior before the command invocation > is to use a prefix argument. A comment in `dired-shell-stuff-it' > says: ...much agreed -- if these had not already established their own usage of the prefix arg. The command dired-do-async-shell-command uses the prefix arg like dired-do-shell-command, that is, the prefix arg is one method (besides the mark) to determine the file list the shell commands will work on. Changing this established behavior for dired-do-async-shell-command (while possibly keeping the current behavior for dired-do-shell-command) is probably confusing. > ;; Might be redefined for smarter things and could then use RAW-ARG > ;; (coming from interactive P and currently ignored) to decide what to do. > ;; Smart would be a way to access basename or extension of file names. > > I don't know how it was intended to be implemented a smart way, but > maybe the same could be used to specify how to run dired async commands? I guess that this can only refer to the handling of file arguments, but the prefix cannot be used (anymore) for a completely different purpose. Currently the COMMAND arg knows three special characters, *. ?, and &. How about a fourth character ";"? More specifically: & means: run asynchronously, separating with & ; means: run asynchronously, separating with ; I believe this should not break too much backward compatibility because ; normally needs to be protected anyway. Then & becomes the default of dired-do-async-shell-command. Anyway, & is appended only if it is not yet present. Or am I missing something? Would this break something? From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Jul 2012 08:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Roland Winkler" Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134234199414398 (code B ref 10598); Sun, 15 Jul 2012 08:47:02 +0000 Received: (at 10598) by debbugs.gnu.org; 15 Jul 2012 08:46:34 +0000 Received: from localhost ([127.0.0.1]:41691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqKTK-0003k6-1J for submit@debbugs.gnu.org; Sun, 15 Jul 2012 04:46:34 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:40047 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqKTE-0003jp-Rt for 10598@debbugs.gnu.org; Sun, 15 Jul 2012 04:46:30 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 7CFAA451CAE3; Sun, 15 Jul 2012 01:40:39 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> <20479.59979.797807.988643@gargle.gargle.HOWL> <878vem8z9i.fsf@mail.jurta.org> <20482.30360.86756.671195@gargle.gargle.HOWL> Date: Sun, 15 Jul 2012 11:29:17 +0300 In-Reply-To: <20482.30360.86756.671195@gargle.gargle.HOWL> (Roland Winkler's message of "Sun, 15 Jul 2012 02:51:52 -0500") Message-ID: <87k3y51l7m.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Currently the COMMAND arg knows three special characters, *. ?, and > &. How about a fourth character ";"? More specifically: > > & means: run asynchronously, separating with & > ; means: run asynchronously, separating with ; > > I believe this should not break too much backward compatibility > because ; normally needs to be protected anyway. > > Then & becomes the default of dired-do-async-shell-command. Anyway, > & is appended only if it is not yet present. > > Or am I missing something? Would this break something? Yes, it seems this is what remains to do. It's implemented in the following patch: === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-04-17 01:52:00 +0000 +++ lisp/dired-aux.el 2012-07-15 08:27:04 +0000 @@ -546,8 +546,16 @@ (defun dired-read-shell-command (prompt (defun dired-do-async-shell-command (command &optional arg file-list) "Run a shell command COMMAND on the marked files asynchronously. -Like `dired-do-shell-command' but if COMMAND doesn't end in ampersand, -adds `* &' surrounded by whitespace and executes the command asynchronously. +Like `dired-do-shell-command', but adds `&' at the end of COMMAND +to execute it asynchronously. + +When operating on multiple files, asynchronous commands are executed +on each file in parallel. In shell syntax this means separating the +individual commands with `&'. However, when COMMAND ends in `;' or `;&' +then commands are executed in the background on each file sequentially +waiting for each command to terminate before running the next command. +In shell syntax this means separating the individual commands with `;'. + The output appears in the buffer `*Async Shell Command*'." (interactive (let ((files (dired-get-marked-files t current-prefix-arg))) @@ -556,14 +564,10 @@ (defun dired-do-async-shell-command (com (dired-read-shell-command "& on %s: " current-prefix-arg files) current-prefix-arg files))) - (unless (string-match "[*?][ \t]*\\'" command) - (setq command (concat command " *"))) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) (dired-do-shell-command command arg file-list)) -;; The in-background argument is only needed in Emacs 18 where -;; shell-command doesn't understand an appended ampersand `&'. ;;;###autoload (defun dired-do-shell-command (command &optional arg file-list) "Run a shell command COMMAND on the marked files. @@ -655,7 +656,15 @@ (defun dired-shell-stuff-it (command fil ;; Might be redefined for smarter things and could then use RAW-ARG ;; (coming from interactive P and currently ignored) to decide what to do. ;; Smart would be a way to access basename or extension of file names. - (let ((stuff-it + (let* ((in-background (string-match "[ \t]*&[ \t]*\\'" command)) + (command (if in-background + (substring command 0 (match-beginning 0)) + command)) + (sequentially (string-match "[ \t]*;[ \t]*\\'" command)) + (command (if sequentially + (substring command 0 (match-beginning 0)) + command)) + (stuff-it (if (or (string-match dired-star-subst-regexp command) (string-match dired-quark-subst-regexp command)) (lambda (x) @@ -665,13 +674,16 @@ (defun dired-shell-stuff-it (command fil (setq retval (replace-match x t t retval 2))) retval)) (lambda (x) (concat command dired-mark-separator x))))) + (concat (if on-each - (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") + (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) + (if (and in-background (not sequentially)) "&" ";")) (let ((files (mapconcat 'shell-quote-argument file-list dired-mark-separator))) (if (> (length file-list) 1) (setq files (concat dired-mark-prefix files dired-mark-postfix))) - (funcall stuff-it files))))) + (funcall stuff-it files))) + (if in-background "&" "")))) ;; This is an extra function so that it can be redefined by ange-ftp. ;;;###autoload From unknown Sun Jun 22 00:10:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jul 2012 07:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 10598@debbugs.gnu.org Received: via spool by 10598-submit@debbugs.gnu.org id=B10598.134250982517844 (code B ref 10598); Tue, 17 Jul 2012 07:24:02 +0000 Received: (at 10598) by debbugs.gnu.org; 17 Jul 2012 07:23:45 +0000 Received: from localhost ([127.0.0.1]:45174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sr28G-0004dl-5O for submit@debbugs.gnu.org; Tue, 17 Jul 2012 03:23:44 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:59366) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sr28C-0004dc-0N for 10598@debbugs.gnu.org; Tue, 17 Jul 2012 03:23:42 -0400 Received: from pchdb00005.uni-regensburg.de ([132.199.129.10]:43255 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Sr22O-0003Sr-7g; Tue, 17 Jul 2012 03:17:40 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20485.4497.853929.507281@gargle.gargle.HOWL> Date: Tue, 17 Jul 2012 02:17:37 -0500 From: "Roland Winkler" In-Reply-To: <87k3y51l7m.fsf@mail.jurta.org> References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> <20479.59979.797807.988643@gargle.gargle.HOWL> <878vem8z9i.fsf@mail.jurta.org> <20482.30360.86756.671195@gargle.gargle.HOWL> <87k3y51l7m.fsf@mail.jurta.org> X-Mailer: VM 8.2 trial under 24.1.1 (x86_64-unknown-linux-gnu) X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On Sun Jul 15 2012 Juri Linkov wrote: > Yes, it seems this is what remains to do. > It's implemented in the following patch: Thanks a lot, this looks great to me (and also works for me as expected). In the slightly modified version of the patch below, I updated also the docstring for dired-do-shell-command and I unified the indentation. It would be good if the info node "(emacs)Shell Commands in Dired" will be updated, too. --- dired-aux.el~ 2012-07-15 01:08:08.000000000 -0500 +++ dired-aux.el 2012-07-17 02:03:33.000000000 -0500 @@ -539,8 +539,17 @@ (defun dired-do-async-shell-command (command &optional arg file-list) "Run a shell command COMMAND on the marked files asynchronously. -Like `dired-do-shell-command' but if COMMAND doesn't end in ampersand, -adds `* &' surrounded by whitespace and executes the command asynchronously. +Like `dired-do-shell-command', but adds `&' at the end of COMMAND +to execute it asynchronously. + +When operating on multiple files, asynchronous commands are executed +in the background on each file in parallel. In shell syntax this means +separating the individual commands with `&'. However, when COMMAND +ends in `;' or `;&' then commands are executed in the background on each file +sequentially waiting for each command to terminate before running +the next command. In shell syntax this means separating the individual +commands with `;'. + The output appears in the buffer `*Async Shell Command*'." (interactive (let ((files (dired-get-marked-files t current-prefix-arg))) @@ -549,18 +558,14 @@ (dired-read-shell-command "& on %s: " current-prefix-arg files) current-prefix-arg files))) - (unless (string-match "[*?][ \t]*\\'" command) - (setq command (concat command " *"))) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) (dired-do-shell-command command arg file-list)) -;; The in-background argument is only needed in Emacs 18 where -;; shell-command doesn't understand an appended ampersand `&'. ;;;###autoload (defun dired-do-shell-command (command &optional arg file-list) "Run a shell command COMMAND on the marked files. -If no files are marked or a specific numeric prefix arg is given, +If no files are marked or a numeric prefix arg is given, the next ARG files are used. Just \\[universal-argument] means the current file. The prompt mentions the file(s) or the marker, as appropriate. @@ -582,6 +587,15 @@ it, write `*\"\"' in place of just `*'. This is equivalent to just `*' in the shell, but avoids Dired's special handling. +If COMMAND ends in `&', `;', or `;&', execute the shell command +in the background asynchronously. When operating on multiple files +and COMMAND ends in `&', the shell command is executed on each file +in parallel. In shell syntax this means separating the individual commands +with `&'. However, when COMMAND ends in `;' or `;&' then commands +are executed in the background on each file sequentially +waiting for each command to terminate before running the next command. +In shell syntax this means separating the individual commands with `;'. + If COMMAND produces output, it goes to a separate buffer. This feature does not try to redisplay Dired buffers afterward, as @@ -592,9 +606,9 @@ of the Dired buffer, so output files usually are created there instead of in a subdir. -In a noninteractive call (from Lisp code), you must specify -the list of file names explicitly with the FILE-LIST argument, which -can be produced by `dired-get-marked-files', for example." +In a noninteractive call, you must specify the list of file names explicitly +with the FILE-LIST argument, which can be produced by `dired-get-marked-files', +for example." ;;Functions dired-run-shell-command and dired-shell-stuff-it do the ;;actual work and can be redefined for customization. (interactive @@ -648,23 +662,34 @@ ;; Might be redefined for smarter things and could then use RAW-ARG ;; (coming from interactive P and currently ignored) to decide what to do. ;; Smart would be a way to access basename or extension of file names. - (let ((stuff-it - (if (or (string-match dired-star-subst-regexp command) - (string-match dired-quark-subst-regexp command)) - (lambda (x) - (let ((retval command)) - (while (string-match - "\\(^\\|[ \t]\\)\\([*?]\\)\\([ \t]\\|$\\)" retval) - (setq retval (replace-match x t t retval 2))) - retval)) - (lambda (x) (concat command dired-mark-separator x))))) - (if on-each - (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") - (let ((files (mapconcat 'shell-quote-argument - file-list dired-mark-separator))) - (if (> (length file-list) 1) - (setq files (concat dired-mark-prefix files dired-mark-postfix))) - (funcall stuff-it files))))) + (let* ((in-background (string-match "[ \t]*&[ \t]*\\'" command)) + (command (if in-background + (substring command 0 (match-beginning 0)) + command)) + (sequentially (string-match "[ \t]*;[ \t]*\\'" command)) + (command (if sequentially + (substring command 0 (match-beginning 0)) + command)) + (stuff-it + (if (or (string-match dired-star-subst-regexp command) + (string-match dired-quark-subst-regexp command)) + (lambda (x) + (let ((retval command)) + (while (string-match + "\\(^\\|[ \t]\\)\\([*?]\\)\\([ \t]\\|$\\)" retval) + (setq retval (replace-match x t t retval 2))) + retval)) + (lambda (x) (concat command dired-mark-separator x))))) + (concat + (if on-each + (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) + (if (and in-background (not sequentially)) "&" ";")) + (let ((files (mapconcat 'shell-quote-argument + file-list dired-mark-separator))) + (if (> (length file-list) 1) + (setq files (concat dired-mark-prefix files dired-mark-postfix))) + (funcall stuff-it files))) + (if in-background "&" "")))) ;; This is an extra function so that it can be redefined by ange-ftp. ;;;###autoload From unknown Sun Jun 22 00:10:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Roland Winkler" Subject: bug#10598: closed (Re: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually) Message-ID: References: <87394qmmuj.fsf@mail.jurta.org> <87liow9jdf.fsf@niu.edu> X-Gnu-PR-Message: they-closed 10598 X-Gnu-PR-Package: emacs Reply-To: 10598@debbugs.gnu.org Date: Tue, 17 Jul 2012 18:49:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1342550942-10337-1" This is a multi-part message in MIME format... ------------=_1342550942-10337-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10598: 24.0.92; run dired-do-async-shell-command on multiple files individ= ually which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10598@debbugs.gnu.org. --=20 10598: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10598 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1342550942-10337-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10598-done) by debbugs.gnu.org; 17 Jul 2012 18:48:56 +0000 Received: from localhost ([127.0.0.1]:46558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrCpK-0002gS-Vo for submit@debbugs.gnu.org; Tue, 17 Jul 2012 14:48:55 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:55048 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrCpH-0002gI-78 for 10598-done@debbugs.gnu.org; Tue, 17 Jul 2012 14:48:52 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D1FBF451CA0F; Tue, 17 Jul 2012 11:42:47 -0700 (PDT) From: Juri Linkov To: "Roland Winkler" Subject: Re: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Organization: JURTA References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> <20479.59979.797807.988643@gargle.gargle.HOWL> <878vem8z9i.fsf@mail.jurta.org> <20482.30360.86756.671195@gargle.gargle.HOWL> <87k3y51l7m.fsf@mail.jurta.org> <20485.4497.853929.507281@gargle.gargle.HOWL> Date: Tue, 17 Jul 2012 21:41:08 +0300 In-Reply-To: <20485.4497.853929.507281@gargle.gargle.HOWL> (Roland Winkler's message of "Tue, 17 Jul 2012 02:17:37 -0500") Message-ID: <87394qmmuj.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10598-done Cc: 10598-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Thanks a lot, this looks great to me (and also works for me as expected). Thanks, installed and closed. > It would be good if the info node "(emacs)Shell Commands in Dired" > will be updated, too. A NEWS entry for this change has no "---" indication that means it should be documented in the manual before the next release when the functionality is stabilized and there are no more code changes. ------------=_1342550942-10337-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Jan 2012 10:18:04 +0000 Received: from localhost ([127.0.0.1]:42623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RpzvX-0006pd-P7 for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:18:04 -0500 Received: from eggs.gnu.org ([140.186.70.92]:60743) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RpzvW-0006pA-7U for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:18:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpzv0-0007Z8-MK for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:17:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:44092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpzv0-0007Z4-Kv for submit@debbugs.gnu.org; Wed, 25 Jan 2012 05:17:30 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpzuv-0002hN-6k for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpzuq-0007YY-W5 for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:25 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:34108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpzuq-0007YU-Ua for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:20 -0500 Received: from u010774.lc.ehu.es ([158.227.8.163]:53506 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Rpzuq-0002Yr-JY for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2012 05:17:20 -0500 Date: Wed, 25 Jan 2012 04:17:16 -0600 Message-Id: <87liow9jdf.fsf@niu.edu> From: "Roland Winkler" To: bug-gnu-emacs@gnu.org Subject: 24.0.92; run dired-do-async-shell-command on multiple files individually X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Within dired, I want to run a shell command asynchronously on multiple files individually. Say, most specifically I tried to watch the postscript files foo.ps and bar.ps with gv. So I mark foo.ps and bar.ps in the dired buffer and hit & gv ? In the buffer *Async Shell Command* this gives me the error message /bin/bash: -c: line 0: syntax error near unexpected token `;' /bin/bash: -c: line 0: `gv foo.ps &;gv bar.ps' I get the same error message with the command dired-do-shell-command using ! gv ? & I am not the most experienced bash expert. But it seems that bash doesn't like the combination `&;'. Note also that there is no `&' for `gv bar.ps'. In a tty $ gv foo.ps & gv bar.ps & works fine for me (giving me what I expect to get within dired). Am I misunderstanding the docstrings of dired-do-shell-command and dired-do-async-shell-command (which are a bit confusing for me concerning how to run a shell command on multiple files) or is there a bug in the code? In GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2011-12-14 on regnitz Windowing system distributor `The X.Org Foundation', version 11.0.10706000 ------------=_1342550942-10337-1-- From unknown Sun Jun 22 00:10:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "John Wiegley" Subject: bug#11815: closed (Re: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually) Message-ID: References: <87394qmmuj.fsf@mail.jurta.org> X-Gnu-PR-Message: they-closed 11815 X-Gnu-PR-Package: emacs Reply-To: 11815@debbugs.gnu.org Date: Tue, 17 Jul 2012 18:49:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1342550942-10337-3" This is a multi-part message in MIME format... ------------=_1342550942-10337-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10598: 24.1; Confusing behavior of & in Dired which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11815@debbugs.gnu.org. --=20 10598: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10598 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1342550942-10337-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10598-done) by debbugs.gnu.org; 17 Jul 2012 18:48:56 +0000 Received: from localhost ([127.0.0.1]:46558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrCpK-0002gS-Vo for submit@debbugs.gnu.org; Tue, 17 Jul 2012 14:48:55 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:55048 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrCpH-0002gI-78 for 10598-done@debbugs.gnu.org; Tue, 17 Jul 2012 14:48:52 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D1FBF451CA0F; Tue, 17 Jul 2012 11:42:47 -0700 (PDT) From: Juri Linkov To: "Roland Winkler" Subject: Re: bug#10598: 24.0.92; run dired-do-async-shell-command on multiple files individually Organization: JURTA References: <87liow9jdf.fsf@niu.edu> <87obtsqbiw.fsf@mail.jurta.org> <20255.60373.371008.208639@gargle.gargle.HOWL> <87394x8im1.fsf@mail.jurta.org> <20478.42579.593253.620476@lukas.physics.niu.edu> <871ukg9i6m.fsf@mail.jurta.org> <20479.59979.797807.988643@gargle.gargle.HOWL> <878vem8z9i.fsf@mail.jurta.org> <20482.30360.86756.671195@gargle.gargle.HOWL> <87k3y51l7m.fsf@mail.jurta.org> <20485.4497.853929.507281@gargle.gargle.HOWL> Date: Tue, 17 Jul 2012 21:41:08 +0300 In-Reply-To: <20485.4497.853929.507281@gargle.gargle.HOWL> (Roland Winkler's message of "Tue, 17 Jul 2012 02:17:37 -0500") Message-ID: <87394qmmuj.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10598-done Cc: 10598-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Thanks a lot, this looks great to me (and also works for me as expected). Thanks, installed and closed. > It would be good if the info node "(emacs)Shell Commands in Dired" > will be updated, too. A NEWS entry for this change has no "---" indication that means it should be documented in the manual before the next release when the functionality is stabilized and there are no more code changes. ------------=_1342550942-10337-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Jun 2012 08:36:39 +0000 Received: from localhost ([127.0.0.1]:36323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SkWgx-0005bO-1h for submit@debbugs.gnu.org; Fri, 29 Jun 2012 04:36:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36411) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SkWgv-0005bH-Kv for submit@debbugs.gnu.org; Fri, 29 Jun 2012 04:36:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkWcj-00079f-JN for submit@debbugs.gnu.org; Fri, 29 Jun 2012 04:32:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkWcj-00079P-EY for submit@debbugs.gnu.org; Fri, 29 Jun 2012 04:32:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkWca-0005gK-SO for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2012 04:32:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkWcO-0006xc-RY for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2012 04:32:08 -0400 Received: from mail-yw0-f48.google.com ([209.85.213.48]:59199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkWcO-0006x6-KT for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2012 04:31:56 -0400 Received: by yhfq46 with SMTP id q46so2322006yhf.35 for ; Fri, 29 Jun 2012 01:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:organization:message-id:user-agent :mail-followup-to:mime-version:content-type; bh=qiUAEuqAKEebT0iNwmINwqx/LfVXGxFjyqZnOi3EL/c=; b=D+Gnl7nl2ttBIw+nMMHnAGMofGuEXfOvKJJwW2rAPlnkaNDAB/6LqBoqEhwzoONCXs lduZOVmoC/OPS3caAJFWtLU/ocLLBbGK92CGXhiSlTP0nOYBTFbpHT0g9RYAUnAg82Nx hTyFQSpwVwtWjefD6E0hpIV1anmjSoWjxcUo6uiCkdxkUSKOmWbzLZHehM1U7ZPs/ELM JbQR3mUCT455SKzOPO3odmQ9/S5aDKH25JsaiT1NEHnxiP3JyxYR2jTeLo39RIWC/dtM 1HHwDOQoVZJJFntkb5Gr2MHEno0b/a6s7HVomx4LmwC6cOpNEUIODsLj0XJ5UmbFa0CZ KxXg== Received: by 10.42.62.211 with SMTP id z19mr361907ich.2.1340958714524; Fri, 29 Jun 2012 01:31:54 -0700 (PDT) Received: from vulcan.local (c-98-215-105-167.hsd1.il.comcast.net. [98.215.105.167]) by mx.google.com with ESMTPS id nh1sm1418019igc.11.2012.06.29.01.31.52 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jun 2012 01:31:52 -0700 (PDT) Received: by vulcan.local (Postfix, from userid 501) id 02BBBF22ADB6; Fri, 29 Jun 2012 03:31:50 -0500 (CDT) From: "John Wiegley" To: bug-gnu-emacs@gnu.org Subject: 24.1; Confusing behavior of & in Dired Date: Fri, 29 Jun 2012 03:29:25 -0500 Organization: New Artisans LLC Message-ID: User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (darwin) Mail-Followup-To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) If I mark several files in dired and press !, I can execute: rsync -av * jw:/srv/ftp/pub I can also run: rsync -av * jw:/srv/ftp/pub & But if I type &, I cannot run: rsync -av * jw:/srv/ftp/pub Because this is equivalent to: rsync -av * jw:/srv/ftp/pub * & It actually decribes this behavior in the docstring: with the & command, if no & appears at the end of the line (which makes little sense, since I pressed & to indicate it was asynchronous), Dired adds "* &". ?? I think that the following equivalence should hold: ! COMMAND & == & COMMAND The fix is simply to change the two lines in `dired-do-async-shell-command' which append " *" to the end of the line to read: (unless (string-match "[ \t][*?][ \t]" command) (setq command (concat command " *"))) Thanks, John In GNU Emacs 24.1.1 (x86_64-apple-darwin11.4.0, Carbon Version 1.6.0 AppKit 1138.47) of 2012-06-28 on vulcan.local ------------=_1342550942-10337-3--