all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jean Louis <bugs@gnu.support>
Cc: 47432@debbugs.gnu.org, arthur.miller@live.com
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	[thread overview]
Message-ID: <83czvjofw1.fsf@gnu.org> (raw)
In-Reply-To: <YGA1TYQhw9FSP1C4@protected.localdomain> (message from Jean Louis on Sun, 28 Mar 2021 10:50:37 +0300)

> Date: Sun, 28 Mar 2021 10:50:37 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: 47432@debbugs.gnu.org
> 
> * Arthur Miller <arthur.miller@live.com> [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.





  reply	other threads:[~2021-03-28  8:13 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
2021-03-28  7:50           ` Jean Louis
2021-03-28  8:13             ` Eli Zaretskii [this message]
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

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

  git send-email \
    --in-reply-to=83czvjofw1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=47432@debbugs.gnu.org \
    --cc=arthur.miller@live.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.