unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Jean Louis <bugs@gnu.support>
Cc: 47432@debbugs.gnu.org
Subject: bug#47432: 28.0.50; Dired using ! or & on file should fail without command supplied
Date: Sat, 27 Mar 2021 21:28:31 +0100	[thread overview]
Message-ID: <AM9PR09MB49775A46E06CD9CD3A296DD196609@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <YF9/WJKF+70mmgDG@protected.localdomain> (Jean Louis's message of "Sat, 27 Mar 2021 21:54:16 +0300")

Jean Louis <bugs@gnu.support> writes:

> * Arthur Miller <arthur.miller@live.com> [2021-03-27 17:00]:
>> How you seen the docs? For example C-h k ! RET:
>> 
>> Signature
>> (dired-do-shell-command COMMAND &optional ARG FILE-LIST)
>> 
>> Documentation
>> Run a shell command COMMAND on the marked files.
>> 
>> 
>> > Why should there be attempt to execute non-executable files?
>> 
>> Because you asked it to by calling ! or & on a file in Dired.
>
> I have got a feeling you have not get really what is taking place:
>
> 1. Dired mode
> 2. Come on any file or directory, not executable
> 3. Press ! or &
> 4. Press ENTER
> 5. Get error, it can be different, depending of situation. Like
>    /usr/bin/bash: line 1: admin_Leo: command not found where "admin_Leo"
>     is directory
>
> I cannot see in the documentation that ! or & in Dired is supposed to
> run that specific marked file as COMMAND. I can understand that
> command is asked and user should enter the command. But I do not see
> that the marked file is supposed to be executed as COMMAND when
> command is not manually entered by user.
>
> Why is Emacs trying to execute a directory?
>
> Why is Emacs trying to execute non-executable file?
>
> - documentation of the function should maybe reflect that ! or & is
>   meant to execute the marked file or current file in Dired if no
>   COMMAND is supplied manually.
>
> - Emacs should stop trying to execute directories or non executable
>   files.

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. 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?

You are asking it to do stuff that shell already does. Emacs can
probably implement shell functionality on it's own, but I guess
it was simplicity of implementation in that case.

Doing extra checks would save one process invocation, but does it really
matter in this case?





  reply	other threads:[~2021-03-27 20:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27  7:09 bug#47432: 28.0.50; Dired using ! or & on file should fail without command supplied Jean Louis
2021-03-27  7:51 ` Arthur Miller
2021-03-27  8:42   ` Jean Louis
2021-03-27 13:59     ` Arthur Miller
2021-03-27 18:54       ` Jean Louis
2021-03-27 20:28         ` Arthur Miller [this message]
2021-03-28  7:50           ` Jean Louis
2021-03-28  8:13             ` Eli Zaretskii
2021-03-29 18:51               ` Jean Louis
2021-03-29 19:23                 ` Eli Zaretskii
2021-03-28 14:03 ` Lars Ingebrigtsen
2021-03-28 15:00   ` Andreas Schwab
2021-03-28 15:06     ` Lars Ingebrigtsen
2021-03-29 18:55     ` Jean Louis
2021-03-29 18:34   ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB49775A46E06CD9CD3A296DD196609@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=47432@debbugs.gnu.org \
    --cc=bugs@gnu.support \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).