From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis 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 10:50:37 +0300 Message-ID: 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="20331"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) Cc: 47432@debbugs.gnu.org To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 28 09:55:11 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 1lQQGM-0005Ag-Uw for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 09:55:11 +0200 Original-Received: from localhost ([::1]:57416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQQGL-0006bb-FO for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 03:55:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQQGE-0006bF-Ge for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 03:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQQGE-0004DW-8z for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 03:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lQQGE-0000mr-7w for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 03:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Mar 2021 07:55: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.16169180732986 (code B ref 47432); Sun, 28 Mar 2021 07:55:02 +0000 Original-Received: (at 47432) by debbugs.gnu.org; 28 Mar 2021 07:54:33 +0000 Original-Received: from localhost ([127.0.0.1]:45368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQQFl-0000m4-EV for submit@debbugs.gnu.org; Sun, 28 Mar 2021 03:54:33 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:60481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQQFh-0000lq-Vs for 47432@debbugs.gnu.org; Sun, 28 Mar 2021 03:54:32 -0400 Original-Received: from localhost ([::ffff:41.202.241.58]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E082.000000006060362E.0000182E; Sun, 28 Mar 2021 00:54:22 -0700 Content-Disposition: inline In-Reply-To: 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:203151 Archived-At: * 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. As in shell when I press RET after prompt, nothing happens. $ RET $ In Dired, if cursor is positioned on directory "admin_leo", the prompt says: ! on admin_leo: Even the prompt is pointing to direction that command is to be executed on the file "admin_leo". If I press RET without entering any command, why is there an error? It should not be there. > If you don't supply a COMMAND it just passes entire list to shell > and shell tries to execute the first file in the list. If there is a > shebang in that file it will get executed in proper interpretter. If > not shell will repport you an error. Would you try to execute your > admin_Leo in terminal? Guess not. So why would you try in Dired? That is your opinion that I have "tried executing admin_Leo" in terminal, not that I share it. In my opinion that is a bug: - 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." Now if I press RET instead of providing "command string in the minibuffer" what is supposed to happen? I don't think there should be nonsensical error to the user. >From manual: File: emacs.info, Node: Shell Commands in Dired, Next: Transforming File Names, Prev: Operating on Files, Up: Dired 30.8 Shell Commands in Dired ============================ 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. The files that the shell command operates on are determined in the usual way for Dired commands (*note Operating on Files::). The command ‘X’ is a synonym for ‘!’. 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. 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? It is bug as if there was no command supplied message should say something like "No command supplied." In Dired if I press RET after !, without supplying command, it should say something like "No command supplied.". If it is expected to run the file where cursors is located, than this shall be reflected in the manual, I do not see that fact, but I can see that I can do ! on executable file and run that file this way. However, manual and function should be aligned in its descriptions. 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. There shall be conditions before trying to do the impossible, so that user get proper message. Does it matter? Yes it does matter for quality of interaction. Jean