From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47432: 28.0.50; Dired using ! or & on file should fail without command supplied Date: Sun, 28 Mar 2021 11:13:02 +0300 Message-ID: <83czvjofw1.fsf@gnu.org> References: <86sg4hnkdo.fsf@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16045"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47432@debbugs.gnu.org, arthur.miller@live.com To: Jean Louis Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 28 10:14:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQQYk-00044R-06 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 10:14:10 +0200 Original-Received: from localhost ([::1]:34468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQQYi-0001Tu-Ol for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 04:14:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQQYc-0001Tn-Jw for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 04:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQQYc-00076z-BN for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 04:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lQQYc-0001E0-6l for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 04:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Mar 2021 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47432 X-GNU-PR-Package: emacs Original-Received: via spool by 47432-submit@debbugs.gnu.org id=B47432.16169191874635 (code B ref 47432); Sun, 28 Mar 2021 08:14:02 +0000 Original-Received: (at 47432) by debbugs.gnu.org; 28 Mar 2021 08:13:07 +0000 Original-Received: from localhost ([127.0.0.1]:45372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQQXj-0001Ch-7V for submit@debbugs.gnu.org; Sun, 28 Mar 2021 04:13:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQQXg-0001CC-7d for 47432@debbugs.gnu.org; Sun, 28 Mar 2021 04:13:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49741) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQQXa-0006Sf-Do; Sun, 28 Mar 2021 04:12:58 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1278 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lQQXY-0000av-Qn; Sun, 28 Mar 2021 04:12:57 -0400 In-Reply-To: (message from Jean Louis on Sun, 28 Mar 2021 10:50:37 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203152 Archived-At: > Date: Sun, 28 Mar 2021 10:50:37 +0300 > From: Jean Louis > Cc: 47432@debbugs.gnu.org > > * Arthur Miller [2021-03-27 23:29]: > > Emacs is not executing them, Emacs is passing them to the shell. Same > > happends as if you tried to execute that file from the command > > prompt. > > Maybe in your opinion, not that I have same opinion, look: > > In Emacs, I press ! because I wish to write a command to be executed > on the file, not to execute empty command which I did not write. When > I press RET without entering command, I expect nothing to happen. Is this expectation consistent with the documentation of '!'? Specifically, how are you sure that an empty COMMAND does nothing in the shell? > As in shell when I press RET after prompt, nothing happens. > > $ RET > $ With that shell, perhaps. But Emacs doesn't know what shell will be invoked, it depends on various factors outside of Dired's control. > - description of function does not say that empty RET should be > considered "COMMAND", there is no mentioning (I could miss it maybe) > that file itself will be executed; > > - info manual does not reflect that what you are speaking. It says: > "The Dired command ‘!’ (‘dired-do-shell-command’) reads a shell > command string in the minibuffer, and runs that shell command on one > or more files." None of the above says anything about the effect of an empty string as COMMAND. > If I press in this mail-mode buffer M-! I am invited to enter string > that will be executed as shell command, if I then press RET, I get > message: (Shell command succeeded with no output) -- this is also > wrong in my opinion, as if I have not entered any command, it should > not say "Shell command succeeded" -- rather, "No shell command > supplied." -- as trying to execute empty string as command does not > make sense. You explicitly ignore the fact that many Emacs commands provide defaults when the user just types RET? > When I press M-& in mail-mode buffer (or other but dired), and I press > RET, I get message like: ": finished." -- which is also incorrect > message, it also means nothing specific. It does not help user. It is > confusing. What means colon in this space and how is colon finished? The colon is a shell command that does nothing. I's probably explained in the manual of your shell. > However, why should ! or & in Dired try to execute non-executable > file, they shall verify if it is directory, if no command was > supplied, they should not try to execute directory name as shell > command. You are assigning certain semantics to the command arguments, but the real semantics is assigned by the shell, not by Emacs. As Arthur says, Emacs just passes the arguments to the shell. So I think your expectations, while they are true in many cases, don't have to be true always.