From unknown Sat Jun 21 10:20:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#11815 <11815@debbugs.gnu.org> To: bug#11815 <11815@debbugs.gnu.org> Subject: Status: 24.1; Confusing behavior of & in Dired Reply-To: bug#11815 <11815@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:20:58 +0000 retitle 11815 24.1; Confusing behavior of & in Dired reassign 11815 emacs submitter 11815 "John Wiegley" severity 11815 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 29 04:36:39 2012 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 11 05:33:15 2012 Received: (at 11815) by debbugs.gnu.org; 11 Jul 2012 09:33:16 +0000 Received: from localhost ([127.0.0.1]:33026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SotIJ-0001Db-8T for submit@debbugs.gnu.org; Wed, 11 Jul 2012 05:33:15 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:39243 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SotIG-0001DT-SG for 11815@debbugs.gnu.org; Wed, 11 Jul 2012 05:33:13 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6B46B451CA3E for <11815@debbugs.gnu.org>; Wed, 11 Jul 2012 02:27:43 -0700 (PDT) From: Juri Linkov To: 11815@debbugs.gnu.org Subject: Re: bug#11815: 24.1; Confusing behavior of & in Dired Organization: JURTA References: Date: Wed, 11 Jul 2012 12:21:23 +0300 In-Reply-To: (John Wiegley's message of "Fri, 29 Jun 2012 03:29:25 -0500") Message-ID: <87y5mqslf0.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: 11815 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 that the following equivalence should hold: > > ! COMMAND & == & COMMAND The problem is that the equivalence should be rather following: & COMMAND == ! COMMAND * & because the file names should be stuffed before the ampersand. And also: & COMMAND * == ! COMMAND * & & COMMAND * ARG2 == ! COMMAND * ARG2 & A reliable fix consistent with the usage of `*' and `?' would be: === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-04-17 01:52:00 +0000 +++ lisp/dired-aux.el 2012-07-11 09:11:48 +0000 @@ -556,8 +556,9 @@ (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 " *"))) + (if (and (not (string-match dired-quark-subst-regexp command)) + (not (string-match dired-star-subst-regexp command))) + (setq command (concat command " *"))) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) (dired-do-shell-command command arg file-list)) But then what to do with `?'? & COMMAND ? == ! COMMAND FILE1 & COMMAND FILE2 & or & COMMAND ? == ! COMMAND FILE1 ; COMMAND FILE2 & This is why we have bug#10598. The following comment in dired-aux.el provides a useful hint about the history of this function: ;; The in-background argument is only needed in Emacs 18 where ;; shell-command doesn't understand an appended ampersand `&'. `in-background' is the former argument of `dired-do-shell-command' removed by revno 911. It could be revived, but its drawback is that this argument should be added to many functions. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 04:55:56 2012 Received: (at 11815) by debbugs.gnu.org; 12 Jul 2012 08:55:56 +0000 Received: from localhost ([127.0.0.1]:34957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFBj-0002js-JZ for submit@debbugs.gnu.org; Thu, 12 Jul 2012 04:55:55 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:56486 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SpFBf-0002jg-Ug; Thu, 12 Jul 2012 04:55:52 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 8633B451CB17; Thu, 12 Jul 2012 01:50:18 -0700 (PDT) From: Juri Linkov To: 11815@debbugs.gnu.org Subject: Re: bug#11815: 24.1; Confusing behavior of & in Dired Organization: JURTA References: <87y5mqslf0.fsf@mail.jurta.org> Date: Thu, 12 Jul 2012 11:47:34 +0300 In-Reply-To: <87y5mqslf0.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 11 Jul 2012 12:21:23 +0300") Message-ID: <874npd8ixl.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: 11815 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 (-) merge 11815 10598 thanks I'm merging this with bug#10598 because they both can be fixed with one patch that completely removes these two lines from `dired-do-async-shell-command': (unless (string-match "[*?][ \t]*\\'" command) (setq command (concat command " *"))) and takes care about handling this case in `dired-shell-stuff-it'. 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 Sat Jun 21 10:20:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 15 Aug 2012 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator