From unknown Sun Jun 22 13:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43055: 27.1; [PATCH] * lisp/term.el: Use correct exit status in suggested dir-tracking functions Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Aug 2020 03:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43055 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 43055@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15984143319416 (code B ref -1); Wed, 26 Aug 2020 03:59:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Aug 2020 03:58:51 +0000 Received: from localhost ([127.0.0.1]:36990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAmaI-0002Ro-T5 for submit@debbugs.gnu.org; Tue, 25 Aug 2020 23:58:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:45966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAmaG-0002Rg-HG for submit@debbugs.gnu.org; Tue, 25 Aug 2020 23:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAmaG-0002AO-89 for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 23:58:48 -0400 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:60207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAmaE-0008FS-Dq for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 23:58:47 -0400 Received: from [10.253.37.70] (port=13231 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1kAma7-0004vT-FO for bug-gnu-emacs@gnu.org; Wed, 26 Aug 2020 15:58:39 +1200 Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 26 Aug 2020 15:58:39 +1200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_f586529d421c926f0539a8478c23db33" Date: Wed, 26 Aug 2020 15:58:39 +1200 From: Phil Sainty Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- Received-SPF: pass client-ip=60.234.4.34; envelope-from=psainty@orcon.net.nz; helo=smtp-1.orcon.net.nz X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 23:58:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=_f586529d421c926f0539a8478c23db33 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed The shell function overrides suggested in term.el to facilitate directory tracking cause those commands to return a success status unconditionally: cd() { command cd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } pushd() { command pushd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } popd() { command popd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } I.e. if the 'cd' fails, we are ignoring that and instead returning the 'printf' exit status. I believe these should be: cd() { command cd "$@" && printf '\033AnSiTc %s\n' "$PWD"; } pushd() { command pushd "$@" && printf '\033AnSiTc %s\n' "$PWD"; } popd() { command popd "$@" && printf '\033AnSiTc %s\n' "$PWD"; } If the command fails, no dir-tracking update should be needed in Emacs (so it's fine not to do that part), and we will see the exit status for the original command, so I think this is all that's required. Patch attached. -Phil --=_f586529d421c926f0539a8478c23db33 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-lisp-term.el-Use-correct-exit-status-in-suggested-di.patch Content-Disposition: attachment; filename=0001-lisp-term.el-Use-correct-exit-status-in-suggested-di.patch; size=1073 RnJvbSBkNWU0YTZmYjUzMzE1NjIxZWQxNjE5ODZkOWQwMWMzYzJiYjc0MzU3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsIFNhaW50eSA8cHNhaW50eUBvcmNvbi5uZXQubno+CkRh dGU6IFdlZCwgMjYgQXVnIDIwMjAgMTU6NDA6MzMgKzEyMDAKU3ViamVjdDogW1BBVENIXSAqIGxp c3AvdGVybS5lbDogVXNlIGNvcnJlY3QgZXhpdCBzdGF0dXMgaW4gc3VnZ2VzdGVkCiBkaXItdHJh Y2tpbmcgZnVuY3Rpb25zCgotLS0KIGxpc3AvdGVybS5lbCB8IDYgKysrLS0tCiAxIGZpbGUgY2hh bmdlZCwgMyBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3Av dGVybS5lbCBiL2xpc3AvdGVybS5lbAppbmRleCAwOWRmZWI2MWQxLi40MDFlZTdkODU5IDEwMDY0 NAotLS0gYS9saXNwL3Rlcm0uZWwKKysrIGIvbGlzcC90ZXJtLmVsCkBAIC0yNDEsOSArMjQxLDkg QEAKIDs7CQlwcmludGYgJ1wwMzNBblNpVHUgJXNcbicgIiRVU0VSIgogOzsJCXByaW50ZiAnXDAz M0FuU2lUYyAlc1xuJyAiJFBXRCIKIDs7Ci07OwkJY2QoKSAgICB7IGNvbW1hbmQgY2QgICAgIiRA IjsgcHJpbnRmICdcMDMzQW5TaVRjICVzXG4nICIkUFdEIjsgfQotOzsJCXB1c2hkKCkgeyBjb21t YW5kIHB1c2hkICIkQCI7IHByaW50ZiAnXDAzM0FuU2lUYyAlc1xuJyAiJFBXRCI7IH0KLTs7CQlw b3BkKCkgIHsgY29tbWFuZCBwb3BkICAiJEAiOyBwcmludGYgJ1wwMzNBblNpVGMgJXNcbicgIiRQ V0QiOyB9Cis7OwkJY2QoKSAgICB7IGNvbW1hbmQgY2QgICAgIiRAIiAmJiBwcmludGYgJ1wwMzNB blNpVGMgJXNcbicgIiRQV0QiOyB9Cis7OwkJcHVzaGQoKSB7IGNvbW1hbmQgcHVzaGQgIiRAIiAm JiBwcmludGYgJ1wwMzNBblNpVGMgJXNcbicgIiRQV0QiOyB9Cis7OwkJcG9wZCgpICB7IGNvbW1h bmQgcG9wZCAgIiRAIiAmJiBwcmludGYgJ1wwMzNBblNpVGMgJXNcbicgIiRQV0QiOyB9CiA7Owog OzsJCSMgVXNlIGN1c3RvbSBkaXJjb2xvcnMgaW4gdGVybSBidWZmZXJzLgogOzsJCSMgZXZhbCAk KGRpcmNvbG9ycyAkSE9NRS8uZW1hY3NfZGlyY29sb3JzKQotLSAKMi4xNy4xCgo= --=_f586529d421c926f0539a8478c23db33-- From unknown Sun Jun 22 13:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43055: 27.1; [PATCH] * lisp/term.el: Use correct exit status in suggested dir-tracking functions Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Aug 2020 10:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43055 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Phil Sainty Cc: 43055@debbugs.gnu.org Received: via spool by 43055-submit@debbugs.gnu.org id=B43055.159843624821222 (code B ref 43055); Wed, 26 Aug 2020 10:05:01 +0000 Received: (at 43055) by debbugs.gnu.org; 26 Aug 2020 10:04:08 +0000 Received: from localhost ([127.0.0.1]:37424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAsHo-0005WE-Dz for submit@debbugs.gnu.org; Wed, 26 Aug 2020 06:04:08 -0400 Received: from quimby.gnus.org ([95.216.78.240]:53404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAsHn-0005W1-KM for 43055@debbugs.gnu.org; Wed, 26 Aug 2020 06:04:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xefx2t5CBlQSY2xj5yqilrpb/kUFk8JoREtg/iSr4do=; b=YWa6cTDytM7/nc6IlPdLp8CPzH ERhXElpbhr4PeYoMnmCEDQEFTbf3GzG9lZ8N0qrOGOsziizc85R7DS16ooOAGpqsyu6rXE3efid2t 5LIUc3AYMi4DwNB/H2JuZbqAnLNgmUxkSxjFjF5jVsc7Qm4LXNBLT4hpeCO09DjL/t18=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAsHe-0003zj-Ub; Wed, 26 Aug 2020 12:04:01 +0200 From: Lars Ingebrigtsen References: X-Now-Playing: Various's _Kaleidoscope (1)_: "Pokus - Pokus One" Date: Wed, 26 Aug 2020 12:03:57 +0200 In-Reply-To: (Phil Sainty's message of "Wed, 26 Aug 2020 15:58:39 +1200") Message-ID: <87h7sp3er6.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Phil Sainty writes: > If the command fails, no dir-tracking update should be needed in > Emacs (so it's fine not to do that part), and we will see the exit > status for the original command, so I think this is all that's [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Phil Sainty writes: > If the command fails, no dir-tracking update should be needed in > Emacs (so it's fine not to do that part), and we will see the exit > status for the original command, so I think this is all that's > required. Makes sense to me. I've now applied the patch to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 26 06:04:15 2020 Received: (at control) by debbugs.gnu.org; 26 Aug 2020 10:04:15 +0000 Received: from localhost ([127.0.0.1]:37427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAsHu-0005WW-Mb for submit@debbugs.gnu.org; Wed, 26 Aug 2020 06:04:14 -0400 Received: from quimby.gnus.org ([95.216.78.240]:53418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAsHt-0005WD-HO for control@debbugs.gnu.org; Wed, 26 Aug 2020 06:04:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=j3Jp7Ty46lt7gSzmHc+T+RyIFLWo+yzbugvmrpW5kxM=; b=mU5Ccrvo7F9bGMF+Con6WCdSrS 68m2K+V57GRPodaCZbhT2s6Dw2qh2iG3LU1M2h0gP5/OXBr6x1mCkz7mDiTj+0/F2yY01/mKmifcn ncQR0JNaKHhCXZ7WJm8pbKnqPeQvzxwU8LsQxzt1eUT175tMdccgrzHDMbFrkNBvkLoo=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAsHl-0003zu-Q8 for control@debbugs.gnu.org; Wed, 26 Aug 2020 12:04:08 +0200 Date: Wed, 26 Aug 2020 12:04:04 +0200 Message-Id: <87ft893eqz.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43055 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43055 fixed close 43055 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 43055 fixed close 43055 28.1 quit