From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72018: 30.0.60; [PATCH] Don't emit a prompt when a background Eshell process is killed Date: Wed, 10 Jul 2024 20:34:57 +0300 Message-ID: <86y169m9q6.fsf@gnu.org> References: <86frsho5u2.fsf@gnu.org> <6a233903-b1df-3d8b-1c25-e6b4b40b4cd5@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29419"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72018@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 10 19:36:15 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 1sRbEk-0007S5-L6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jul 2024 19:36:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRbET-0000F1-Ta; Wed, 10 Jul 2024 13:35:57 -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 1sRbES-0000DJ-GA for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2024 13:35:56 -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 1sRbES-0007M2-82 for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2024 13:35:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRbEY-0003uh-DT for bug-gnu-emacs@gnu.org; Wed, 10 Jul 2024 13:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jul 2024 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72018 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72018-submit@debbugs.gnu.org id=B72018.172063295215025 (code B ref 72018); Wed, 10 Jul 2024 17:36:02 +0000 Original-Received: (at 72018) by debbugs.gnu.org; 10 Jul 2024 17:35:52 +0000 Original-Received: from localhost ([127.0.0.1]:57087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRbEN-0003uG-Ou for submit@debbugs.gnu.org; Wed, 10 Jul 2024 13:35:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRbEM-0003u2-7l for 72018@debbugs.gnu.org; Wed, 10 Jul 2024 13:35:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRbEA-0007Kl-MD; Wed, 10 Jul 2024 13:35:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XJChHqPjeEK/mYFFKFPcNfU+bNhT2CI51fLNbI6nULI=; b=kDJVzAiLRTcI CvI8MPMGPvPjaL19UFnnMyiMfmywR8De63l3EtV2DLnwue1V245RWnH4I1lvWlpqcizx9hd99zye4 GGAPCKYSBumDiAZwyUfdvSW3X+/HrbeYX2yoVzs/OaVOxcpK8ROB4TWhMujN1W1/6INGIksYyQteP k0QiPLgjAPO+AUJ3CyegtmdokMWaaX0qzSDIDmb5VYy5IVGhl3ZdTIhpDrfXApxbdDdYH5NoZe30e fkhdbrt7Trs8sOLQ3Taq3VfjLRdyHXHWHl5J0N2WJ3UChh6gioHDnw+MGDBHvh7KcnjXdIklTpcZX 1JDDSbsGfiF2/bls0lyODA==; In-Reply-To: <6a233903-b1df-3d8b-1c25-e6b4b40b4cd5@gmail.com> (message from Jim Porter on Wed, 10 Jul 2024 09:16:11 -0700) 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:288691 Archived-At: > Date: Wed, 10 Jul 2024 09:16:11 -0700 > Cc: 72018@debbugs.gnu.org > From: Jim Porter > > On 7/10/2024 4:16 AM, Eli Zaretskii wrote: > > > > I don't think I understand the essence of the change, and thus cannot > > appreciate its effects enough to be able to answer this. What is the > > significance of '(car command)' in this hunk: > > 'command' is a "command entry", and the result of > 'eshell-commands-for-process', which returns a list of elements of the form: > > (BACKGROUND FORM PROCESSES) > > BACKGROUND is non-nil if the command is being run in the background. > > >> + ;; Reset the prompt if the command we just aborted was in the > >> + ;; foreground. > >> + (unless (car command) > >> + (declare-function eshell-reset "esh-mode" (&optional no-hooks)) > >> + (eshell-reset))))))) > > > > IOW, why '(car command)' is used as an indication of a fore/background > > command? Also, why does the comment say "foreground" while your text > > says we don't want the prompt if the killed program was in the > > background? > > We want to reset the prompt (this just emits a new command prompt) for > foreground commands, but for background commands, we don't need to do > anything. Would it be clearer if I inverted the wording in the comment, > like, "Don't reset the prompt if the command we just aborted was in the > background"? I think these subtleties just warrant more detailed comments, and then we'll be fine.