GNU bug report logs - #47991
28.0.50; inconsistency between async-shell-command and shell-command

Previous Next

Package: emacs;

Reported by: Zhiwei Chen <condy0919 <at> gmail.com>

Date: Sat, 24 Apr 2021 10:39:01 UTC

Severity: minor

Tags: wontfix

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47991 in the body.
You can then email your comments to 47991 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47991; Package emacs. (Sat, 24 Apr 2021 10:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zhiwei Chen <condy0919 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 24 Apr 2021 10:39:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zhiwei Chen <condy0919 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; inconsistency between async-shell-command and shell-command
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.

AFAIK, async-shell-command is implemented via shell-command with an
additional '&' sign if it doesn't end with it.

To reproduce:
   emacs -Q
   M-x shell-command SPC ls RET
   M-x async-shell-command SPC ls RET

-- 
Zhiwei Chen




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47991; Package emacs. (Sat, 24 Apr 2021 10:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 47991 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Zhiwei Chen <condy0919 <at> gmail.com>
Cc: 47991 <at> debbugs.gnu.org
Subject: Re: bug#47991: 28.0.50;
 inconsistency between async-shell-command and shell-command
Date: Sat, 24 Apr 2021 13:57:21 +0300
> From: Zhiwei Chen <condy0919 <at> gmail.com>
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47991; Package emacs. (Sun, 25 Apr 2021 16:39:01 GMT) Full text and rfc822 format available.

Message #11 received at 47991 <at> debbugs.gnu.org (full text, mbox):

From: Zhiwei Chen <condy0919 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47991 <at> debbugs.gnu.org
Subject: Re: bug#47991: 28.0.50; inconsistency between async-shell-command
 and shell-command
Date: Mon, 26 Apr 2021 00:38:10 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Zhiwei Chen <condy0919 <at> gmail.com>
>> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47991; Package emacs. (Sun, 25 Apr 2021 16:52:01 GMT) Full text and rfc822 format available.

Message #14 received at 47991 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Zhiwei Chen <condy0919 <at> gmail.com>, Richard Stallman <rms <at> gnu.org>
Cc: 47991 <at> debbugs.gnu.org
Subject: Re: bug#47991: 28.0.50; inconsistency between async-shell-command
 and shell-command
Date: Sun, 25 Apr 2021 19:50:59 +0300
> From: Zhiwei Chen <condy0919 <at> gmail.com>
> Cc: 47991 <at> debbugs.gnu.org
> Date: Mon, 26 Apr 2021 00:38:10 +0800
> 
> 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.

I don't know, it's been that way since 1995.  Maybe Richard remembers.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47991; Package emacs. (Mon, 26 Apr 2021 04:43:01 GMT) Full text and rfc822 format available.

Message #17 received at 47991 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: condy0919 <at> gmail.com, 47991 <at> debbugs.gnu.org
Subject: Re: bug#47991: 28.0.50; inconsistency between async-shell-command
 and shell-command
Date: Mon, 26 Apr 2021 00:41:53 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

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

  > I don't know, it's been that way since 1995.  Maybe Richard remembers.

This decision seems correct to me.

The code of Shell mode is mainly meant for (1) handling the output as
it arrives asynchronously and (2) editing shell input.

In M-!, there is no need for either of those things.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47991; Package emacs. (Sun, 02 May 2021 09:12:02 GMT) Full text and rfc822 format available.

Message #20 received at 47991 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, condy0919 <at> gmail.com, 47991 <at> debbugs.gnu.org
Subject: Re: bug#47991: 28.0.50; inconsistency between async-shell-command
 and shell-command
Date: Sun, 02 May 2021 11:11:21 +0200
Richard Stallman <rms <at> gnu.org> writes:

> The code of Shell mode is mainly meant for (1) handling the output as
> it arrives asynchronously and (2) editing shell input.
>
> In M-!, there is no need for either of those things.

So it doesn't sound like we want to change this, and I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 02 May 2021 09:12:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 47991 <at> debbugs.gnu.org and Zhiwei Chen <condy0919 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 02 May 2021 09:12:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 May 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.