From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#71554: 29.3; eshell-command async buffer behavior Date: Sat, 06 Jul 2024 06:10:42 +0000 Message-ID: <87zfqvvyn1.fsf@posteo.net> References: <87frtfpqyn.fsf@librehacker.com> <87ikyb8igc.fsf@posteo.net> <86tthvwdxp.fsf@gnu.org> <87ed8z8duo.fsf@posteo.net> <87a5jm94b6.fsf@posteo.net> <874j9ogjfo.fsf@posteo.net> <3ed3832f-e874-ab89-52c3-c0c32650cb33@gmail.com> <86o77qbjv9.fsf@gnu.org> <87r0c87a48.fsf@posteo.net> <86plrs75my.fsf@gnu.org> <87r0c8nyp4.fsf@posteo.net> <865xtk6qkl.fsf@gnu.org> <87le2gyqq8.fsf@posteo.net> <87h6d3zz52.fsf@posteo.net> <877cdz7k6g.fsf@posteo.net> <87r0c7xinq.fsf@posteo.net> <88dd9e27-6593-db9b-2d17-cd5ae7abf547@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2191"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thierry Volpiatto , christopher@librehacker.com, Eli Zaretskii , 71554@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 06 08:08:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sPyap-0000LK-Ad for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jul 2024 08:08:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPyaW-0003Ue-Ll; Sat, 06 Jul 2024 02:08:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPyaV-0003US-2T for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 02:07:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPyaU-0003Jz-QJ for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 02:07:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPyaX-0005OO-V5 for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 02:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jul 2024 06:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71554 X-GNU-PR-Package: emacs Original-Received: via spool by 71554-submit@debbugs.gnu.org id=B71554.172024607420712 (code B ref 71554); Sat, 06 Jul 2024 06:08:01 +0000 Original-Received: (at 71554) by debbugs.gnu.org; 6 Jul 2024 06:07:54 +0000 Original-Received: from localhost ([127.0.0.1]:45398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPyaQ-0005O0-Dt for submit@debbugs.gnu.org; Sat, 06 Jul 2024 02:07:54 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:51357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPyaO-0005Nk-Vf for 71554@debbugs.gnu.org; Sat, 06 Jul 2024 02:07:53 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B597D240027 for <71554@debbugs.gnu.org>; Sat, 6 Jul 2024 08:07:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720246062; bh=Q0Yyg3xGT6F7Sc4qbty9td1+7uWzT4WzKKi1pRP0rMk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Autocrypt:OpenPGP:From; b=FKwgaR5bRR6br1AJYe9Iq1VrI7k4qAorFBlJE0sUrmqskTXOsvFVLaqlowtdtAgwP o9S78kD61PlXBJzFLwLUsRpLcGEDAe076E8Oe7Juvj9ti96sc5C++Iy2zcXu5DppR9 FXFe/FmAurem/mWF1aNMu5ZBpgsHDrRi7QmIFDD7mQqcVOsDr2C1tXP3l/MqMXS9nv I8B7LvKZUpadRgpyNmAnGEkyTHvnytLP7Q4QvoFzJ+EJQAowvnJMLUY1d+UUOeI0wq dXHBsoLRVIK9qCbWsv6fOVmZ8BZ4Admiz2GRLFkJ957hmV+RLMEllQQZtxsmhTXZer 7fQze+zuEsZYg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WGKfz6Qg5z6twv; Sat, 6 Jul 2024 08:07:39 +0200 (CEST) In-Reply-To: <88dd9e27-6593-db9b-2d17-cd5ae7abf547@gmail.com> (Jim Porter's message of "Fri, 5 Jul 2024 22:28:56 -0700") Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata=xsDNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA Ac0SdGhpZXZvbEBwb3N0ZW8ubmV0wsEOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQaA OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288454 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Jim Porter writes: > On 7/5/2024 9:12 PM, Thierry Volpiatto wrote: >> (cond >> ((with-current-buffer bufname >> (and (null eshell-foreground-command) >> (null eshell-background-commands))) >> ;; The old buffer is done executing; kill it so we can >> ;; take its place. >> (kill-buffer bufname)) >> What if user ran a serie of commands and want to see the output of >> each >> one? > > I did that to preserve the logic of 'shell-command': if there's no > running process in the buffer, it will get reused. That's the > Eshell-ified analogue to this bit in 'shell-command': > > ;; Ask the user what to do with already running process. > (when proc ;; <-- This line. > (cond > ((eq async-shell-command-buffer 'confirm-kill-process) > ... > > Is that always what users want? I don't think so, I for one prefer keeping the buffers around to see the output of each commands: If I run: com1 & com2 & com3 & I expect=20 *buf* <=3D> com1 *buf<1>* <=3D> com2 *buf<2>* <=3D> com3 What if com3 overwrite *buf* where com1 exited with error, I have no clue of what happened to com1. I can't retrieve the initial bug report of Christopher, IIRC he was describing his workflow running several shell commands, don't remember if he had to examine each process buffer. Christopher? > Hard to say. Still, I think behaving like 'shell-command' is a good > thing in order to follow the principle of least surprise. Yes but following exactly what 'shell-command' does prevents improving both. > (If we changed the behavior in 'eshell-command', I think we'd want to > do the same in 'shell-command' too.) > > For users who *do* want something like that behavior, I think there > are two options: > > 1. You could redirect the output in the Eshell command you enter at > the prompt. For example: > > do-something &> (generate-new-buffer "mybuf") & > > That would put the output from "do-something" into a unique buffer, > running it asynchronously. (It wouldn't display the buffer by default, > though with a bit of Elisp you could make it do that too.) > > 2. We could patch 'eshell-command' to be more like 'shell-command', > and have a signature like: > > (defun eshell-command (command &optional output-buffer error-buffer) > ...) > > That way, you could output to a unique buffer (or any Eshell target, > in fact) by passing it as an argument. I have a WIP patch to add this. In both options, IMHO it is to much to write in addition of the shell command itself. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmaI3+ITHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk591C/0evHMt7L6BprcG8OW29v56HvMpp5CU kELK2p4Q3Sps2pT0sA2VknW12MQAOaUndjNfi8jOCQb0V75mEuV07KeN4Fdeq136 NrCMTcMWac2qD1d4+aAkEI38HhBij9Ph/oDzd7V2XQHEdvq1fSa3WQK0FtDIXpdl MnGayee7Hyd3INNY6yGQoU9ROKeJTU1ZtmqgQ8fC4l9ClWs+mk03ar5MT2EYsKnh /9PLuQLclFGfq+rHxoSTjDSew1lulXkRuKeGB2QqD30XibTG8ITUCBWOXfnM5q0M fvPpt4ie+AoHiQ/scZsUXyPnNTG4MreImC6t4M6D7itlgIAYg9q/5ecjdQ4g2VKB rww4EYNg2F2ZSjY8zgxbH0HT5joWGjSv55P98eWS60lhk8QvjLlku44grnKColxq Zw93HjISiI2/wGfKPyL5EL2SGFG6TTzGbEnMAHwskFh6a9cL7wc2KaGwhnFYRKLM KzVAjmRVI09jPTZgZCBnmQccmqa+mAq+hs4= =erWm -----END PGP SIGNATURE----- --=-=-=--