Subject: bug#47991: 28.0.50; inconsistency between async-shell-command and shell-command

From: Zhiwei Chen <[email-masked]>
Date: Mon, 26 Apr 2021 00:38:10 +0800

Eli Zaretskii <[email-masked]> writes:

>> From: Zhiwei Chen <[email-masked]>
>> Date: Sat, 24 Apr 2021 18:38:12 +0800
>> 
>> 
>> shell-command pops a buffer in fundamental-mode while
>> async-shell-command is in shell-mode.
>
> That's a feature.
>
> Why do you want the buffer in shell-mode when the command is run
> synchronously?

The original intention is to make `async-shell-command` and
`shell-command` default to `evil-normal-state' by adding a hook in which
checks if `this-command' is `shell-command' or `async-shell-command'.

As a result, I found that they behave differently. It looks too odd that
`async-shell-command' is implemented in `shell-command' but it has a
different semantic.

Since the buffer is in `fundamental-mode', there is no way to access
`shell-mode-map' where user maybe define their own bindings.

I'm curious about the reason why it's a feature. Why the synchronous
`shell-command' should be in `fundamental-mode' while the async doesn't.

-- 
Zhiwei Chen