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#65604: [PATCH] Display the exit code if the last command failed in Eshell Date: Thu, 31 Aug 2023 07:52:16 +0300 Message-ID: <83a5u7g6f3.fsf@gnu.org> References: <87cyz5wjtm.fsf@mssdvd.com> <05108d35-d095-c975-78b8-6b00fc7e6a08@gmail.com> <87o7iolg6o.fsf@mssdvd.com> <83v8cwfphy.fsf@gnu.org> <87wmxc4ah3.fsf@mssdvd.com> <83fs40fi35.fsf@gnu.org> <87msy8s344.fsf@mssdvd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12947"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65604@debbugs.gnu.org, jporterbugs@gmail.com, me@eshelyaron.com To: Davide Masserut Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 31 06:53:29 2023 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 1qbZgO-0003Df-R3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 06:53:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbZfr-0004G4-JC; Thu, 31 Aug 2023 00:52:55 -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 1qbZfq-0004Ad-SV for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 00:52:54 -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 1qbZfq-00043A-Ka for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 00:52:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbZfy-000152-I5 for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 00:53: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: Thu, 31 Aug 2023 04:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65604 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65604-submit@debbugs.gnu.org id=B65604.16934575714135 (code B ref 65604); Thu, 31 Aug 2023 04:53:02 +0000 Original-Received: (at 65604) by debbugs.gnu.org; 31 Aug 2023 04:52:51 +0000 Original-Received: from localhost ([127.0.0.1]:54590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbZfm-00014b-Us for submit@debbugs.gnu.org; Thu, 31 Aug 2023 00:52:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbZfj-00014M-Mc for 65604@debbugs.gnu.org; Thu, 31 Aug 2023 00:52:48 -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 1qbZfW-0003xg-7p; Thu, 31 Aug 2023 00:52:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=7sSjeRK4EfaqyIST8ugvXC/UVx1TB4bK4kWVWzpx3n4=; b=DZw48cECz2xDrLKU/zws 9NKIUfIdS3fvnAhZA1RCBWSxAwCKs/zPgZi+qVlCl8PQqmwu+xDQTPYbgqON2lOeAemzF2VqnUlGj aZeiWOucEmhuKHcV/WOOHAp1sQ6zIsQXUoiIMpHc8qcr9JRDw3RnhFu9uWcnTb6QQ8/9kiNN37yRg AeODPzQjJ/+CzAcMEseE3TXHtdIBQrGjAzqtqVG846Yeb+3PPntVoTa+oJerb4bxeAihv9WMW0xcL 9JwzhWVvAqI9N+hi+r16Ama2NR9W91zBlfqZaDMMsDV/txUMuqa34+pTUndzKWIBNvu464hUzXxVI lk2dSNC+X6ONEw==; In-Reply-To: <87msy8s344.fsf@mssdvd.com> (message from Davide Masserut on Wed, 30 Aug 2023 21:59:35 +0200) 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:268775 Archived-At: > From: Davide Masserut > Cc: me@eshelyaron.com, 65604@debbugs.gnu.org, jporterbugs@gmail.com > Date: Wed, 30 Aug 2023 21:59:35 +0200 > > Unless SYMBOL is marked as risky (i.e., it has a non-‘nil’ > ‘risky-local-variable’ property), all text properties > specified in > SYMBOL’s value are ignored. This includes the text > properties of > strings in SYMBOL’s value, as well as all ‘:eval’ and > ‘:propertize’ > forms in it. (The reason for this is security: non-risky > variables > could be set automatically from file variables without > prompting > the user.) > > > Given this code: > > (defun eshell-mode-line-exit-code () > (when (> eshell-last-command-status 0) > (propertize > (format ":[%s]" eshell-last-command-status) > 'help-echo (format "Last command exited with code %s" > eshell-last-command-status) > 'face 'compilation-mode-line-fail))) > > (setq-local mode-line-process 'eshell-mode-line-exit-code) > > Doesn't it mean that unless we mark it "risky-local-variable", > Emacs will remove the "compilation-mode-line-fail" face? Ah, that. Yes, the properties will be ignored. But do we really need fancy faces on that display? (FWIW, I personally don't like the idea of showing this on the mode line: the mode line is already quite cramped, and OTOH Bash does show abnormal exit codes as part of its prompt. But feel free to disregard my opinions, as I'm not a heavy user of Eshell.)