GNU bug report logs - #71049
async-shell-command ends with "Process *Async Shell Command* finished" when remote "direct-async-process"

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dmitry <at> gutov.dev>

Date: Sun, 19 May 2024 00:20:02 UTC

Severity: normal

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 71049 <at> debbugs.gnu.org
Subject: Re: bug#71049: async-shell-command ends with "Process *Async Shell
 Command* finished" when remote "direct-async-process"
Date: Fri, 31 May 2024 09:27:36 +0200
Dmitry Gutov <dmitry <at> gutov.dev> writes:

> Hi Michael,

Hi Dmitry,

> 1) [first patch] We can add a new major mode, for 'M-&' to use instead
> of the full-blown 'shell-mode' - it could be very simple: just apply
> font-lock keywords and maybe set list-buffers-directory.
>
> Problems? I suppose someone might be using shell-mode-hook to do
> something in the async-shell-command output buffer, and it won't fire
> anymore. Seemingly very minor concern.

This is not only for 'M-&', but for any place asynchronous
'shell-command' is called. You miss a lot of settings 'shell-mode'
applies. No idea whether people need this in async 'shell-command'.

> diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
> index 9385b023392..f0c64a7a90f 100644
> --- a/lisp/net/tramp.el
> +++ b/lisp/net/tramp.el
> @@ -5247,8 +5247,8 @@ tramp-handle-shell-command
>  	      ;; Display output.
>  	      (with-current-buffer output-buffer
>  		(setq mode-line-process '(":%s"))
> -		(unless (eq major-mode 'shell-mode)
> -		  (shell-mode))
> +		(unless (eq major-mode 'shell-command-mode)
> +		  (shell-command-mode))
>  		(set-process-filter p #'comint-output-filter)
>  		(set-process-sentinel p #'shell-command-sentinel)
>  		(when error-file

You want to make this backward compatible, down to Emacs 27.

> diff --git a/lisp/shell.el b/lisp/shell.el
> index e6b315ee5c0..7fa84a37e83 100644
> --- a/lisp/shell.el
> +++ b/lisp/shell.el
> @@ -838,6 +838,13 @@ shell-write-history-on-exit
>        (with-current-buffer buf
>          (insert (format "\nProcess %s %s\n" process event))))))
>
> +(define-derived-mode shell-command-mode comint-mode "Shell"
> +  "Major mode for the output of `async-shell-command'."

"... of asynchronous `shell-command'."

Best regards, Michael.




This bug report was last modified 1 year and 81 days ago.

Previous Next


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