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: Mon, 29 Mar 2021 21:51:41 +0300 Message-ID: References: <86sg4hnkdo.fsf@protected.rcdrun.com> <83czvjofw1.fsf@gnu.org> 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="4070"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) Cc: 47432@debbugs.gnu.org, Lars Ingebrigtsen , arthur.miller@live.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 29 20:59:12 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 1lQx6W-0000v1-Q0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Mar 2021 20:59:12 +0200 Original-Received: from localhost ([::1]:58824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQx6V-0006w1-RO for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Mar 2021 14:59:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQx4Q-0005DV-Q3 for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2021 14:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQx4Q-000251-I2 for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2021 14:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lQx4P-0000nz-Jy for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2021 14:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Mar 2021 18:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 47432-submit@debbugs.gnu.org id=B47432.16170442073067 (code B ref 47432); Mon, 29 Mar 2021 18:57:01 +0000 Original-Received: (at 47432) by debbugs.gnu.org; 29 Mar 2021 18:56:47 +0000 Original-Received: from localhost ([127.0.0.1]:49610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQx46-0000nK-5b for submit@debbugs.gnu.org; Mon, 29 Mar 2021 14:56:47 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:34719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQx42-0000my-5o for 47432@debbugs.gnu.org; Mon, 29 Mar 2021 14:56:41 -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 000000000001E1BA.00000000606222DE.000005DA; Mon, 29 Mar 2021 11:56:30 -0700 Content-Disposition: inline In-Reply-To: <83czvjofw1.fsf@gnu.org> 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:203266 Archived-At: * Eli Zaretskii [2021-03-28 11:13]: > > 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? In some cases it does call the marked file, but those other cases should be excluded -- or documentation improved to tell users why is it so. Since Larse explained about the concatenation of COMMAND and FILE-LIST, I understand technically why is that happening, but I do not understand logic behind it. When there are let us say 50 images that I wish to convert, and if I forget to give a command like ! * [on 50 files]: mogrify -format jpg and instead I give "" then all those pictures will be "executed", attempted to be executed. That makes no sense to me > > - 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. That is basically what I am pointing out, thank you, but seem that we have disagreement. In my opinion: - it should be clear WHY is it useful to allow empty string to be accepted as COMMAND as the logical function should execute COMMAND as non-empty string; - document that so that it becomes clear; I am myself still trying to understand as the prompt says to execute ON files, not to execute files. - documentation of the function and info manual should be aligned with that functionality; - and still I think that images and various files, directories, should not be executed. Only if the file has executable bit it should be executed -- this is current behavior on executable files. Let me give you more from researching how it works: - if there is script.pl or script.sh, then ! or & will verify for executable bit, and execute it only if set; BUT it is not executing THE FILE which is marked! Replicate it by putting one non-executable script.sh in your PATH and going to directory that is not in your path that has executable script.sh in that path, do ! or & on that command. script.sh: #!/bin/bash echo Hello, it worked ---- put same script in your PATH, like maybe ~/bin/script.sh and make it non-executable. put same file, but executable in other directory ~/tmp/script.sh go with Dired to ~/tmp/script.sh as it is executable, so do ! or & and it will try to execute which file? Definitely not ~/tmp/script.sh but it will try to execute "script.sh" in PATH. So think about that, there is no logic that FILE-LIST is appended to empty COMMAND like "" as that FILE-LIST is not getting executed really, so it is misleading the user. Jean Louis Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns