From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 27 02:29:52 2023 Received: (at submit) by debbugs.gnu.org; 27 Jun 2023 06:29:52 +0000 Received: from localhost ([127.0.0.1]:47457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qE2D2-0006B8-2M for submit@debbugs.gnu.org; Tue, 27 Jun 2023 02:29:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:43446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qE0Uk-00032s-CP for submit@debbugs.gnu.org; Tue, 27 Jun 2023 00:40:03 -0400 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 1qE0Ug-0005Km-0E for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 00:40:01 -0400 Received: from robust-software.ca ([2607:f2f8:a680:0:582c:1928:cb2b:1a91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qE0Ud-0000Wo-Kv for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 00:39:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=/FRUB+xrvC/bZ fwLo0e1qUQQUqn9kq1tAh+OuzQtej8=; h=date:subject:to:from; d=oneofus.la; b=tY+rYbu4nxG27elhVCM942ekcEDJl9fzzWMH7q8+QmLk5ZqT4QhPXfh6JQqdwiBg5Ad+ cOuAxP7vtFBDjbAP4/ZoejwdEDi+6yBQ6SRcfawr+PQA1aqPuWKNsm/v/lVq1tJRQ5yVbE OlJ8vpfqWkaUjVkeJ4rv3NRTsRv/sVim4= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6wbxvh8blpivjl.ipv6.telus.net [2001:56a:f913:3c01:117c:4f07:9ae2:4d31]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 3b1bb257 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 26 Jun 2023 21:39:52 -0700 (PDT) User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers Date: Mon, 26 Jun 2023 22:39:50 -0600 Message-ID: <87pm5h4iy1.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f2f8:a680:0:582c:1928:cb2b:1a91; envelope-from=vas@oneofus.la; helo=robust-software.ca X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 27 Jun 2023 02:29:50 -0400 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 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Fix shell-dirtrack-mode showing up as enabled in unrelated buffers shell-dirtrack-mode always shows up in unrelated buffers. Steps to reproduce: 1. emacs -q 2. M-x shell 3. describe-mode (C-h m) in *scratch* or *GNU Emacs* This is because shell-dirtrack-mode is aliased to shell-dirtrackp, which has default value t. Changes in this patch: mark shell-dirtrackp obsolete replace existing occurrences of shell-dirtrackp with shell-dirtrack-mode add :interactive (shell-mode) suggestion to shell-dirtrack-mode shell-dirtrack-mode is still turned on by default. There is an explicit call to (shell-dirtrack-mode 1) in the definition of shell-mode. Definition of shell-dirtrack-mode is moved to quiet warning about reference to free variable =E2=80=98shell-dirtrack-mode=E2=80=99. Note: I am not sure what to put for WHEN on the obsolete variable. Does that get filled in when merging? -- Vladimir Sedach --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-test-lisp-shell-tests.el-added-tests-for-shell-dirtr.patch >From 4f803f5f2c3e4df48e6509cf238dc420cebc4a0a Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Mon, 26 Jun 2023 22:30:25 -0600 Subject: [PATCH 1/2] ; * test/lisp/shell-tests.el: added tests for shell-dirtrack-mode --- test/lisp/shell-tests.el | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el index db9124e2435..ddddfdb2e0f 100644 --- a/test/lisp/shell-tests.el +++ b/test/lisp/shell-tests.el @@ -64,4 +64,35 @@ shell-tests-split-string (should (equal (split-string-shell-command "ls /tmp/foo\\ bar") '("ls" "/tmp/foo bar"))))) +(ert-deftest shell-dirtrack-on-by-default () + (with-temp-buffer + (shell-mode) + (should shell-dirtrack-mode))) + +(ert-deftest shell-dirtrack-should-not-be-on-in-unrelated-modes () + (with-temp-buffer + (should (not shell-dirtrack-mode)))) + +(ert-deftest shell-dirtrack-sets-list-buffers-directory () + (let ((start-dir default-directory)) + (with-temp-buffer + (should-not list-buffers-directory) + (shell-mode) + (shell-cd "..") + (should list-buffers-directory) + (should (not (equal start-dir list-buffers-directory))) + (should (string-prefix-p list-buffers-directory start-dir))))) + +(ert-deftest shell-directory-tracker-cd () + (let ((start-dir default-directory)) + (with-temp-buffer + (should-not list-buffers-directory) + (shell-mode) + (cl-letf (((symbol-function 'shell-unquote-argument) + (lambda (x) x))) + (shell-directory-tracker "cd ..")) + (should list-buffers-directory) + (should (not (equal start-dir list-buffers-directory))) + (should (string-prefix-p list-buffers-directory start-dir))))) + ;;; shell-tests.el ends here -- 2.20.1 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0002-Fix-shell-dirtrack-mode-showing-up-as-enabled-in-unr.patch Content-Transfer-Encoding: quoted-printable >From 623704526b081c0d453a84d517f9d02035755504 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Mon, 26 Jun 2023 22:32:07 -0600 Subject: [PATCH 2/2] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit ; shell-dirtrack-mode always shows up in unrelated buffers. ; Steps to reproduce: ; 1. emacs -q ; 2. M-x shell ; 3. describe-mode (C-h m) in *scratch* or *GNU Emacs* ; This is because shell-dirtrack-mode is aliased to shell-dirtrackp, ; which has default value t. ; Changes in this patch: ; mark shell-dirtrackp obsolete ; replace existing occurrences of shell-dirtrackp with shell-dirtrack-mode ; add :interactive (shell-mode) suggestion to shell-dirtrack-mode ; shell-dirtrack-mode is still turned on by default. There is an ; explicit call to (shell-dirtrack-mode 1) in the definition of ; shell-mode. ; Definition of shell-dirtrack-mode is moved to quiet warning about ; reference to free variable =E2=80=98shell-dirtrack-mode=E2=80=99. --- lisp/shell.el | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lisp/shell.el b/lisp/shell.el index b74442f1961..39e12577280 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -346,10 +346,10 @@ shell-dirstack "List of directories saved by pushd in this buffer's shell. Thus, this does not include the shell's current directory.") =20 -(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) - -(defvar shell-dirtrackp t - "Non-nil in a shell buffer means directory tracking is enabled.") +(define-obsolete-variable-alias 'shell-dirtrackp 'shell-dirtrack-mode + "???" + "Non-nil in a shell buffer means directory tracking is enabled. +Use the minor mode variable `shell-dirtrack-mode' instead.") =20 (defvar shell-last-dir nil "Keep track of last directory for ksh `cd -' command.") @@ -997,6 +997,20 @@ shell ;; replace it with a process filter that watches for and strips out ;; these messages. =20 +(define-minor-mode shell-dirtrack-mode + "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). + +The `dirtrack' package provides an alternative implementation of +this feature; see the function `dirtrack-mode'. Also see +`comint-osc-directory-tracker' for an escape-sequence based +solution." + :lighter nil + :interactive (shell-mode) + (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) + (if shell-dirtrack-mode + (add-hook 'comint-input-filter-functions #'shell-directory-tracker n= il t) + (remove-hook 'comint-input-filter-functions #'shell-directory-tracker = t))) + (defun shell-directory-tracker (str) "Tracks cd, pushd and popd commands issued to the shell. This function is called on each input passed to the shell. @@ -1013,7 +1027,7 @@ shell-directory-tracker and `shell-pushd-dunique' control the behavior of the relevant command. =20 Environment variables are expanded, see function `substitute-in-file-name'= ." - (if shell-dirtrackp + (if shell-dirtrack-mode ;; We fail gracefully if we think the command will fail in the shell. ;;; (with-demoted-errors "Directory tracker failure: %s" ;; This fails so often that it seems better to just ignore errors (?= ). @@ -1167,23 +1181,10 @@ shell-extract-num (and (string-match "^\\+[1-9][0-9]*$" str) (string-to-number str))) =20 -(define-minor-mode shell-dirtrack-mode - "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). - -The `dirtrack' package provides an alternative implementation of -this feature; see the function `dirtrack-mode'. Also see -`comint-osc-directory-tracker' for an escape-sequence based -solution." - :lighter nil - (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) - (if shell-dirtrack-mode - (add-hook 'comint-input-filter-functions #'shell-directory-tracker n= il t) - (remove-hook 'comint-input-filter-functions #'shell-directory-tracker = t))) - (defun shell-cd (dir) "Do normal `cd' to DIR, and set `list-buffers-directory'." (cd dir) - (if shell-dirtrackp + (if shell-dirtrack-mode (setq list-buffers-directory default-directory))) =20 (defun shell-resync-dirs () --=20 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 27 07:18:47 2023 Received: (at 64311) by debbugs.gnu.org; 27 Jun 2023 11:18:47 +0000 Received: from localhost ([127.0.0.1]:47749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qE6ic-0008F2-UK for submit@debbugs.gnu.org; Tue, 27 Jun 2023 07:18:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qE6ia-0008Ep-NY for 64311@debbugs.gnu.org; Tue, 27 Jun 2023 07:18:45 -0400 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 1qE6iU-0005M2-Ti; Tue, 27 Jun 2023 07:18: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=5FXb1t86rpXN5CrI8/TmLV0QNAtZasQ27+tfG8TobBQ=; b=bqH6pmtk9UGk YHCZOhFe4E+Y4PTDwtC/PN3Hw8u802u6NTPS5mnvR5CqgMQiK3NlhMbmALvRneC20t1Y8BjjXzFNC VaeQ1RSjeP1EysIPN6IyDIAJmDw4MQT8MWn2aqtc0HPQ58uhRKFZ48PNu3w9HpF9cuRtH7/Vl6Bn2 83O986RQTdnJ7WG1oHN6t64dkKFlJxP5Cubh4Q7IcL2Nd+ysCrSMInw02OeRjzhrXp5Hfr3rnGRo8 DVzVUL+uTaIVx0RSuXRQeGNayREHEHBfMO9XDx83X5zYOAxZurfKlgxsKv8ej6j2RbG9tZYO1iHxY AnKeEUF8EqfDEA+XheL8Zg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qE6iR-0007F3-8W; Tue, 27 Jun 2023 07:18:37 -0400 Date: Tue, 27 Jun 2023 14:18:57 +0300 Message-Id: <83h6qtw3tq.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87pm5h4iy1.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Mon, 26 Jun 2023 22:39:50 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Date: Mon, 26 Jun 2023 22:39:50 -0600 > > Fix shell-dirtrack-mode showing up as enabled in unrelated buffers > > shell-dirtrack-mode always shows up in unrelated buffers. > > Steps to reproduce: > 1. emacs -q > 2. M-x shell > 3. describe-mode (C-h m) in *scratch* or *GNU Emacs* In what version of Emacs do you see this? (You didn't include in your report the information collected by "M-x report-emacs-bug", so I cannot know what version and on what OS are you using.) I cannot reproduce this in Emacs 29: "C-h m" after "M-x shell" shows shell-dirtrack-mode only in the *shell* buffer. I do see it in *scratch* in Emacs 28, so I guess we already fixed this? > Note: I am not sure what to put for WHEN on the obsolete variable. > Does that get filled in when merging? No, you need to specify it explicitly. It's the first Emacs version where the variable was declared obsolete, in this case "30.1". (But meanwhile I don't think we need to install this.) Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 27 10:09:30 2023 Received: (at 64311) by debbugs.gnu.org; 27 Jun 2023 14:09:30 +0000 Received: from localhost ([127.0.0.1]:49328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qE9Nq-0001Eu-7Z for submit@debbugs.gnu.org; Tue, 27 Jun 2023 10:09:30 -0400 Received: from robust-software.ca ([174.136.98.50]:3307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qE9Nl-0001Ed-FS for 64311@debbugs.gnu.org; Tue, 27 Jun 2023 10:09:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=bDaFlS2C+gC9b ymI0GXwkWqQICOdY2gOcZ4xBHR03xA=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=f0BhDuIU9LEI+z1+YEbtuabmPpblvlmr6rimt non6NBtg4cYUKuOUyVkBKXl9opOiXftSdARYbMFQYI7aGwsMxD5DEW4rUsA4cZ4xQR45Z2 6h0Mp3iKXkYeNqAjylhXWMzUNZeLfGZRSJW3SDqjuberffwxMQOE3irOywgLE7PA= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6xhh5ry179dtfm.ipv6.telus.net [2001:56a:f913:3c01:5d5b:103:904d:8b42]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 45ab35f4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 27 Jun 2023 07:09:23 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <83h6qtw3tq.fsf@gnu.org> Date: Tue, 27 Jun 2023 08:09:22 -0600 Message-ID: <87wmzp2e0d.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > In what version of Emacs do you see this? (You didn't include in your > report the information collected by "M-x report-emacs-bug", so I > cannot know what version and on what OS are you using.) I cannot > reproduce this in Emacs 29: "C-h m" after "M-x shell" shows > shell-dirtrack-mode only in the *shell* buffer. I do see it in > *scratch* in Emacs 28, so I guess we already fixed this? You are right about the steps to reproduce. What changed in Emacs 29 was describe-mode no longer using minor-mode-list, but (buffer-local-value 'local-minor-modes buffer) instead. This changed in commit 3c059f269e0182bd19df37871585e0b0bf1d47e5 Redo `C-h m' output Wed Apr 13 03:50:06 2022 +0200 This only hides the problem, which is: the default value of shell-dirtrack-mode being t. Revised steps to reproduce: 1. emacs -q 2. M-x shell 3. M-: shell-dirtrack-mode in *scratch* or *GNU Emacs* This is also demonstrated in the test shell-dirtrack-should-not-be-on-in-unrelated-modes from the first patch, which fails without the fix being applied. Attached is a revised patch for the fix, with the obsolete variable version filled in, and updated commit message. Thank you for looking at this. -- Vladimir Sedach --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0002-Fix-shell-dirtrack-mode-showing-up-as-enabled-in-unr.patch Content-Transfer-Encoding: quoted-printable >From 971ac829043c6659acf7b315c0d610de1c7b0d10 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Mon, 26 Jun 2023 22:32:07 -0600 Subject: [PATCH 2/2] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit ; shell-dirtrack-mode always shows up in unrelated buffers. ; Steps to reproduce: ; 1. emacs -q ; 2. M-x shell ; 3. M-: shell-dirtrack-mode in *scratch* or *GNU Emacs* ; This is because shell-dirtrack-mode is aliased to shell-dirtrackp, ; which has default value t. ; Changes in this patch: ; mark shell-dirtrackp obsolete ; replace existing occurrences of shell-dirtrackp with shell-dirtrack-mode ; add :interactive (shell-mode) suggestion to shell-dirtrack-mode ; shell-dirtrack-mode is still turned on by default. There is an ; explicit call to (shell-dirtrack-mode 1) in the definition of ; shell-mode. ; Definition of shell-dirtrack-mode is moved to quiet warning about ; reference to free variable =E2=80=98shell-dirtrack-mode=E2=80=99. --- lisp/shell.el | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lisp/shell.el b/lisp/shell.el index b74442f1961..e6f1c2629f3 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -346,10 +346,10 @@ shell-dirstack "List of directories saved by pushd in this buffer's shell. Thus, this does not include the shell's current directory.") =20 -(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) - -(defvar shell-dirtrackp t - "Non-nil in a shell buffer means directory tracking is enabled.") +(define-obsolete-variable-alias 'shell-dirtrackp 'shell-dirtrack-mode + "30.1" + "Non-nil in a shell buffer means directory tracking is enabled. +Use the minor mode variable `shell-dirtrack-mode' instead.") =20 (defvar shell-last-dir nil "Keep track of last directory for ksh `cd -' command.") @@ -997,6 +997,20 @@ shell ;; replace it with a process filter that watches for and strips out ;; these messages. =20 +(define-minor-mode shell-dirtrack-mode + "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). + +The `dirtrack' package provides an alternative implementation of +this feature; see the function `dirtrack-mode'. Also see +`comint-osc-directory-tracker' for an escape-sequence based +solution." + :lighter nil + :interactive (shell-mode) + (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) + (if shell-dirtrack-mode + (add-hook 'comint-input-filter-functions #'shell-directory-tracker n= il t) + (remove-hook 'comint-input-filter-functions #'shell-directory-tracker = t))) + (defun shell-directory-tracker (str) "Tracks cd, pushd and popd commands issued to the shell. This function is called on each input passed to the shell. @@ -1013,7 +1027,7 @@ shell-directory-tracker and `shell-pushd-dunique' control the behavior of the relevant command. =20 Environment variables are expanded, see function `substitute-in-file-name'= ." - (if shell-dirtrackp + (if shell-dirtrack-mode ;; We fail gracefully if we think the command will fail in the shell. ;;; (with-demoted-errors "Directory tracker failure: %s" ;; This fails so often that it seems better to just ignore errors (?= ). @@ -1167,23 +1181,10 @@ shell-extract-num (and (string-match "^\\+[1-9][0-9]*$" str) (string-to-number str))) =20 -(define-minor-mode shell-dirtrack-mode - "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). - -The `dirtrack' package provides an alternative implementation of -this feature; see the function `dirtrack-mode'. Also see -`comint-osc-directory-tracker' for an escape-sequence based -solution." - :lighter nil - (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) - (if shell-dirtrack-mode - (add-hook 'comint-input-filter-functions #'shell-directory-tracker n= il t) - (remove-hook 'comint-input-filter-functions #'shell-directory-tracker = t))) - (defun shell-cd (dir) "Do normal `cd' to DIR, and set `list-buffers-directory'." (cd dir) - (if shell-dirtrackp + (if shell-dirtrack-mode (setq list-buffers-directory default-directory))) =20 (defun shell-resync-dirs () --=20 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 27 11:52:09 2023 Received: (at 64311) by debbugs.gnu.org; 27 Jun 2023 15:52:09 +0000 Received: from localhost ([127.0.0.1]:49401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEAzA-000474-Ob for submit@debbugs.gnu.org; Tue, 27 Jun 2023 11:52:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEAz9-00046o-6d for 64311@debbugs.gnu.org; Tue, 27 Jun 2023 11:52:08 -0400 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 1qEAz3-0000NU-Jz; Tue, 27 Jun 2023 11:52:01 -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=kUjku3Z+H3hGV0HYa2DGdkb35h0l9zXp0bu3eqwCrTk=; b=ANzIjxWrUchP 3TN7cx83pPffD6e15TenRzgznSJlK288tav1at8hN/JMF2YRFlA0pUF5VNaP3Gpwn/csCUBbLTVKC CTScn1EcgV1UZyRkWyVTC899PFxpdxTpXkMI0xrXGRqR6cUayM9Va8v5aDxihMf3WHvc6fphSmlao 1mfT6+T7TEVlXL7l6k9WfdsXYLkVYYUnkCP/NuL+GsansD7w2Bu8bLHpfrWEvM19S37hCl4lVZe/h 2GQ4Q6yQsQbPKH4ulAK/MNILFr50YOrB9Xmmm/eobILIPRXytWtmBuypsY3LtVJRHdACATPC6caha oEYprkL7gJsjmr4kROsbSg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEAz3-0005oo-49; Tue, 27 Jun 2023 11:52:01 -0400 Date: Tue, 27 Jun 2023 18:52:24 +0300 Message-Id: <831qhwx5qf.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87wmzp2e0d.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Tue, 27 Jun 2023 08:09:22 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Tue, 27 Jun 2023 08:09:22 -0600 > > This changed in commit 3c059f269e0182bd19df37871585e0b0bf1d47e5 > Redo `C-h m' output > Wed Apr 13 03:50:06 2022 +0200 > > This only hides the problem, which is: the default value of > shell-dirtrack-mode being t. Why is that a problem. I understand when it causes irrelevant minor mode to be shown by "C-h m", but why should anyone care that some global variable is non-nil? In any case, I don't think a fix (if we need one) should be so complicated. Why do we need all those changes, including making the variable obsolete and moving the mode from its place in shell.el to another place there? If all you want is to make this variable buffer-local, just making it buffer-local is all that's needed, right? But first, let's talk about the problem: why is shell-dirtrack-mode being t a problem? From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 27 20:54:43 2023 Received: (at 64311) by debbugs.gnu.org; 28 Jun 2023 00:54:43 +0000 Received: from localhost ([127.0.0.1]:49714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEJSF-00018b-8G for submit@debbugs.gnu.org; Tue, 27 Jun 2023 20:54:43 -0400 Received: from robust-software.ca ([174.136.98.50]:27415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEJSA-00018P-Ul for 64311@debbugs.gnu.org; Tue, 27 Jun 2023 20:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=2VzK4KXD442h3 84XZLN16Wl6tsiTbn9SRPFITlCFxWY=; h=in-reply-to:date:subject:cc:to: from:references; d=oneofus.la; b=nqXvV/vOGeH1M8B1uJ1FL2sosRCC+Rnj+LWmZ T3vQ7E81qkK9GUwsKf66op9ytelVkGCLg/rmhyqrzPAPXgxU3bbn0Ngov8JjUaIRkvkZQf ziA9tfZ617tf/NwZdF06V7BkGwtYf6BrbU88F6A6mK+3aBfsgUYTJWmZ74MmQLdY= Received: from orphne.orion.oneofus.la (node-1w7jra28qzk6zp350rgpfps17.ipv6.telus.net [2001:56a:f913:3c01:eec6:50e:d532:8d2b]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 40c8c87c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 27 Jun 2023 17:54:37 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> User-agent: mu4e 1.8.13; emacs 29.0.92 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers Date: Tue, 27 Jun 2023 18:07:27 -0600 In-reply-to: <831qhwx5qf.fsf@gnu.org> Message-ID: <87zg4k76es.fsf@orphne.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > Why is that a problem. I understand when it causes irrelevant minor > mode to be shown by "C-h m", but why should anyone care that some > global variable is non-nil? My understanding is that (define-minor-mode X-mode ...) defines a variable X-mode (the docstring for define-minor-mode calls this a "control variable") that is supposed to be t when the mode is enabled, and nil when the mode is not enabled. Right now the variable shell-dirtrack-mode has a value of t, even when the mode is not enabled. > In any case, I don't think a fix (if we need one) should be so > complicated. Why do we need all those changes, including making the > variable obsolete and moving the mode from its place in shell.el to > another place there? If all you want is to make this variable > buffer-local, just making it buffer-local is all that's needed, > right? shell-dirtrack-mode is already made buffer-local by define-minor-mode. The problem is shell-dirtrackp and its default value. What is shell-dirtrackp? Looking at VC-history for shell-dirtrackp, there are 2 commits: --8<---------------cut here---------------start------------->8--- commit 9c3eeba4db26ddaeead100beea7a96f9fa640918 Author: Glenn Morris Date: Fri Apr 20 18:34:39 2018 -0400 The tedious game of whack-a-mole with compiler warnings continues ... diff --git a/lisp/shell.el b/lisp/shell.el --- a/lisp/shell.el +++ b/lisp/shell.el @@ -317,4 +317,6 @@ +(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) + (defvar shell-dirtrackp t "Non-nil in a shell buffer means directory tracking is enabled.") commit b493a9b2af805a3097fe53fd472884c268248146 Author: Richard M. Stallman Date: Wed Mar 2 16:55:16 1994 +0000 (shell-dirtrackp): Variable definition added. diff --git a/lisp/shell.el b/lisp/shell.el --- a/lisp/shell.el +++ b/lisp/shell.el @@ -226,1 +223,4 @@ +(defvar shell-dirtrackp t + "Non-nil in a shell buffer means directory tracking is enabled.") + --8<---------------cut here---------------end--------------->8--- So it looks like in 1994 rms introduced the variable shell-dirtrackp, before define-minor-mode and the X-mode variable convention. Judging by the documentation string, shell-dirtrackp was intended to do what the automatically defined X-mode variables do now. Then in 2018 rgm aliased shell-dirtrackp to shell-dirtrack-mode to fix a compiler warning. This introduced an incorrect default value for shell-dirtrack-mode. The variable shell-dirtrackp should also have been marked obsolete in rgm's commit. I moved the definition of shell-dirtrack-mode above the first use of the variable shell-dirtrack-mode so there would be no compiler warning (this is noted in the commit message). This also puts the definition of shell-dirtrack-mode right after the long comment for the Directory tracking section explaining the mode's purpose, a nice unintended benefit. > But first, let's talk about the problem: why is shell-dirtrack-mode > being t a problem? If you have a hook that tests if shell-dirtrack-mode is turned on by looking at the value of the variable shell-dirtrack-mode, that hook will not work correctly. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 28 07:46:29 2023 Received: (at 64311) by debbugs.gnu.org; 28 Jun 2023 11:46:29 +0000 Received: from localhost ([127.0.0.1]:50149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qETcz-0004JN-60 for submit@debbugs.gnu.org; Wed, 28 Jun 2023 07:46:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qETcx-0004J8-U8 for 64311@debbugs.gnu.org; Wed, 28 Jun 2023 07:46:28 -0400 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 1qETcr-0005d1-Dw; Wed, 28 Jun 2023 07:46:22 -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=L0DzRaqEAmti5d7iJETKYJ7y+f2bBhIA50K9McSAXDA=; b=e9R8jlgWlAe6 0BvmHGJ5Ub4lsn9rFzrOl2/apU4g37HrgWiLg2th/V8dXs9qKui4k1Ak2DxaS8pUZpcfCqmWhBGKS I61/V8Jsl9hXH65ZY+eM/wpPukLpH5ZLvhkKUu/TF8eVHplNE6O/mcEIXx0dSwzX27m4M8oZwfKiA 00WUzuobBgj6qZW7YW447E3HArnpWtaEPKb1f2kJvXigMSDHkOkLDr++M6Mh6fTbfCghg5IyTkedK 2Nuvo+PbLjYiPbVqDftkGNbAPMlSDbOcl/WjX6ElSCoPb35sYMEOvhzUns/TTwdAn7xsbRp1aNoTT FUh/JunamNTAK4rmfz879g==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qETcq-0004xR-U5; Wed, 28 Jun 2023 07:46:21 -0400 Date: Wed, 28 Jun 2023 14:46:45 +0300 Message-Id: <83mt0jvmfu.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87zg4k76es.fsf@orphne.orion.oneofus.la> (message from Vladimir Sedach on Tue, 27 Jun 2023 18:07:27 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Tue, 27 Jun 2023 18:07:27 -0600 > > > Eli Zaretskii writes: > > > In any case, I don't think a fix (if we need one) should be so > > complicated. Why do we need all those changes, including making the > > variable obsolete and moving the mode from its place in shell.el to > > another place there? If all you want is to make this variable > > buffer-local, just making it buffer-local is all that's needed, > > right? > > shell-dirtrack-mode is already made buffer-local by > define-minor-mode. > > The problem is shell-dirtrackp and its default value. So if we make it also buffer-local, the problem is gone, no? From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 28 12:43:42 2023 Received: (at 64311) by debbugs.gnu.org; 28 Jun 2023 16:43:42 +0000 Received: from localhost ([127.0.0.1]:51513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEYGc-0004Ce-GV for submit@debbugs.gnu.org; Wed, 28 Jun 2023 12:43:42 -0400 Received: from robust-software.ca ([174.136.98.50]:38481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEYGa-0004CU-7T for 64311@debbugs.gnu.org; Wed, 28 Jun 2023 12:43:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=f6T8Mx0dY6KmN SkvT6jU5RuRJt8ba83Ra77Hz7e1qho=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=tpRvYTf9vR28eQc3ThSJF2FvhM+XWqJ3xOWRL i1e181kGK5sFXr6g8fOpRE5pH/DDtMK+cF2grw8Lb50cUIUdoKMr4/kNNwQBvUik55y3Hb /PerVSr59I7T6vwEWgS+0CthF27zrXc1bUixj1uxG3Mz8+XCXqH2svqssO4xG0BI= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6wkpsgbrs21vi6.ipv6.telus.net [2001:56a:f913:3c01:2183:d4bb:5361:f7be]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id b27da171 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 28 Jun 2023 09:43:37 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <83mt0jvmfu.fsf@gnu.org> Date: Wed, 28 Jun 2023 10:43:35 -0600 Message-ID: <87r0pva66g.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > So if we make it also buffer-local, the problem is gone, no? --8<---------------cut here---------------start------------->8--- (local-variable-if-set-p 'shell-dirtrackp) t --8<---------------cut here---------------end--------------->8--- shell-dirtrackp is already buffer-local. Aliased variables share that property. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 28 14:31:18 2023 Received: (at 64311) by debbugs.gnu.org; 28 Jun 2023 18:31:18 +0000 Received: from localhost ([127.0.0.1]:51598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEZwk-0003tt-1U for submit@debbugs.gnu.org; Wed, 28 Jun 2023 14:31:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEZwg-0003td-9p for 64311@debbugs.gnu.org; Wed, 28 Jun 2023 14:31:16 -0400 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 1qEZwa-0005XP-LG; Wed, 28 Jun 2023 14:31:08 -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=By0sbzVyXstZQCpjT50TEkIyTF/eL8sL5A1JjxD/Mms=; b=Wq1pKa1OTo/N cJ93AtvVdhvZeCimtO8uXx2VWE49gwv5vTT8E4OkWStD1jM37P7Ma3qitVWobWY/SkZQ0S9/q0jC6 H75WhlAmn3kxoWKIlrw9IImMzO25lOCrm5pXl3f3oafwi/pFzEPiN+dgndR8tb0O01ST1oQhx9qxP GkKtYUovMuwgghRSl9lXjuKHKbj47lR795lv86lE/a8S/qycYdazO5mVR4DbKz/tRU6Y6V+RLlo5r Jj5jB5KdYQyHZtbxHI3EQc+b0/tiAZVurvSMgbsaRph39Mez/2SXLhZvFD8W9jicVyomr6rqpk02f gV5Yb/fIX6WwGaa9W/aXLQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEZwa-0000aZ-2f; Wed, 28 Jun 2023 14:31:08 -0400 Date: Wed, 28 Jun 2023 21:31:33 +0300 Message-Id: <834jmrv3p6.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87r0pva66g.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Wed, 28 Jun 2023 10:43:35 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Wed, 28 Jun 2023 10:43:35 -0600 > > > Eli Zaretskii writes: > > > So if we make it also buffer-local, the problem is gone, no? > > --8<---------------cut here---------------start------------->8--- > (local-variable-if-set-p 'shell-dirtrackp) > t > --8<---------------cut here---------------end--------------->8--- > > shell-dirtrackp is already buffer-local. Aliased variables share that property. So what exactly is the problem now? You said: > The problem is shell-dirtrackp and its default value. But if this is buffer-local, then why is it a problem that it's non-nil? From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 28 16:14:51 2023 Received: (at 64311) by debbugs.gnu.org; 28 Jun 2023 20:14:51 +0000 Received: from localhost ([127.0.0.1]:51757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEbYx-0006fz-An for submit@debbugs.gnu.org; Wed, 28 Jun 2023 16:14:51 -0400 Received: from robust-software.ca ([174.136.98.50]:42322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEbYu-0006fl-8u for 64311@debbugs.gnu.org; Wed, 28 Jun 2023 16:14:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=+jJNZkRQ8eF9V ec4eYwEITCRovvAD5hkNKkIlSEZPyY=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=bpdAk+tmZb2jbmFtWAU2b9KPAfDsV08Ou95vZ In308mro5339y8kAPV0/bfOcnXe14wYdXLUlEyvSpWjw3bVGkkpiRvd0+n5QlbrhRW6YNC SBij38HHY19VkgNujvCgg1tmB1tuZ+3uMzb0n1teQMQUeMaxSCOit3GWBcfdxC8I= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6wkpsgbrs21vi6.ipv6.telus.net [2001:56a:f913:3c01:2183:d4bb:5361:f7be]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id b3ef730f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 28 Jun 2023 13:14:46 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <834jmrv3p6.fsf@gnu.org> Date: Wed, 28 Jun 2023 14:14:44 -0600 Message-ID: <87o7kz9wej.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > So what exactly is the problem now? You said: > >> The problem is shell-dirtrackp and its default value. > > But if this is buffer-local, then why is it a problem that it's > non-nil? Since shell-dirtrackp is aliased to shell-dirtrack-mode, the default value of shell-dirtrack-mode gets set to t. So shell-dirtrack-mode is t in every buffer. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 00:57:14 2023 Received: (at 64311) by debbugs.gnu.org; 29 Jun 2023 04:57:14 +0000 Received: from localhost ([127.0.0.1]:52015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEjiU-0002ww-4p for submit@debbugs.gnu.org; Thu, 29 Jun 2023 00:57:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEjiO-0002wg-FJ for 64311@debbugs.gnu.org; Thu, 29 Jun 2023 00:57:12 -0400 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 1qEjiI-0002kg-S3; Thu, 29 Jun 2023 00:57:02 -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=F3CmfSuN0K24q8zs5jjzWH33Pzu7US8cQwPgDF6AbWE=; b=gjnxDaSxqoXi ZixYLiTeN6wnlqeV8093Kw0DXx4A9Qwfi6EriaCq4OppbsZGQJayrc6BChuEsMvg2BPX6v7GwhDd5 /MO5gh3ft0HJa4SUCWOIq+AhGbGZyCy/uCsYwnIRF1uKi1z471yY1RxRuZEgmQeq7GoY3ntWBx+J3 w6QCMqLO8LQuYLCaKbtqxqs55NV/SHpp7yqMWRpxqWLT9aP6fa3nnk0RpSbOBTq0dBhd/AEf0e/t1 yxwaMLWKLTvB2re8sRg6z6VZCm1YS9xpkcISASVUp53SRLdRPwaPd3xrVfmy0dZH2BXNjs0X9z1pP YVi2cUheqfNzRka2wDiWsA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEjiA-0003kI-1O; Thu, 29 Jun 2023 00:56:58 -0400 Date: Thu, 29 Jun 2023 07:57:20 +0300 Message-Id: <83wmzmuaq7.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87o7kz9wej.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Wed, 28 Jun 2023 14:14:44 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Wed, 28 Jun 2023 14:14:44 -0600 > > > Eli Zaretskii writes: > > > So what exactly is the problem now? You said: > > > >> The problem is shell-dirtrackp and its default value. > > > > But if this is buffer-local, then why is it a problem that it's > > non-nil? > > Since shell-dirtrackp is aliased to shell-dirtrack-mode, the default > value of shell-dirtrack-mode gets set to t. > > So shell-dirtrack-mode is t in every buffer. So making the default value nil will solve the problem? From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 12:26:47 2023 Received: (at 64311) by debbugs.gnu.org; 29 Jun 2023 16:26:47 +0000 Received: from localhost ([127.0.0.1]:53936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEuTm-0007pB-Qo for submit@debbugs.gnu.org; Thu, 29 Jun 2023 12:26:47 -0400 Received: from robust-software.ca ([174.136.98.50]:35464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEuTi-0007oy-CT for 64311@debbugs.gnu.org; Thu, 29 Jun 2023 12:26:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=pysbR7p/Ztij5 opJchzxpZmMKWlhavpDOGHxD7uVVbo=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=mFGvtCkg1sXQgY0FaqMTCdQuxAXZzefGUfdgq Gh54dhEqWN3LUPFvCVhpSn9f3qQS1Qc+0SGyLWr/zDXxZXvwF9vq5+3o6Z8ZiT9loRw8b3 aL45k8+xaU7BugOQDGXXHUtukI5eEft4UelS70OiiH8y/K8JZlprO0sl0SxymDgk= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6xj57njf87zz1o.ipv6.telus.net [2001:56a:f913:3c01:6067:9d9:8a35:d32c]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 98b60d1c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 29 Jun 2023 09:26:40 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <83wmzmuaq7.fsf@gnu.org> Date: Thu, 29 Jun 2023 10:26:38 -0600 Message-ID: <87wmzmb5fl.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > So making the default value nil will solve the problem? Yes, but you are asking the wrong question. When I came upon this problem, the first questions I had were: what is the variable shell-dirtrackp, and why is it aliased to shell-dirtrack-mode? This is why I came up with a fix that follows the X-mode control variable convention, marks the redundant variable obsolete, replaces any leftover references to the redundant variable with shell-dirtrack-mode, and adds unit tests for the control paths of the affected code. Instead of a half-assed "let's just flip the value of this boolean flag" workaround, that doesn't help or explain anything to someone trying to work with shell.el -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 14:09:58 2023 Received: (at 64311) by debbugs.gnu.org; 29 Jun 2023 18:09:59 +0000 Received: from localhost ([127.0.0.1]:53990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEw5e-0002DD-HL for submit@debbugs.gnu.org; Thu, 29 Jun 2023 14:09:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEw5Z-0002Cu-SX for 64311@debbugs.gnu.org; Thu, 29 Jun 2023 14:09:57 -0400 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 1qEw5T-0008Nn-R6; Thu, 29 Jun 2023 14:09:47 -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=IBb9C9/sAM8cE23W68ZzcVROUwQ4U/7aDwLaZnXwPL0=; b=jALqHAkuSDB8 gA2zRg9K+cgjSbGZ4qwAmdWuiRp9xUuxaYfVm7/nSmITVHVGOCfL3hBHwO85qdOrsy7w8rHMc+BmB YnSME2fT9S0LVoWLZpibr6jYGBvStC8e4WCp0sIMTgGM11qMNkRn79kmGf5KsFKredIfbrZkYe5SV IKdceDFBYpBmor0fw1X11EFRtogzT7lAKy9f2Lrco9eGZuM35Btxno0EbLzMdxpt80ZdAGqU6RTIq Oyv4LNxuVkYqPOUHK/v88vGA0kstlSRnsAdaGWLF6O/5fmc3bBlBq3aJXSefkln+zcsauE0tPmswz CON7TXf8geu11LMLa2FSdw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEw5T-0002Rj-Al; Thu, 29 Jun 2023 14:09:47 -0400 Date: Thu, 29 Jun 2023 21:10:14 +0300 Message-Id: <83a5wita0p.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87wmzmb5fl.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Thu, 29 Jun 2023 10:26:38 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Thu, 29 Jun 2023 10:26:38 -0600 > > > Eli Zaretskii writes: > > > So making the default value nil will solve the problem? > > Yes, but you are asking the wrong question. Am I? Asking about the root cause of the problem is not wrong, because it indicates how best to fix it. > When I came upon this problem, the first questions I had were: what > is the variable shell-dirtrackp, and why is it aliased to > shell-dirtrack-mode? Why would we bother about that? With the exception of the default value, what harm does that variable cause by existing? > This is why I came up with a fix that follows the X-mode control > variable convention, marks the redundant variable obsolete, replaces > any leftover references to the redundant variable with > shell-dirtrack-mode, and adds unit tests for the control paths of the > affected code. Sorry, I'm not interested in making changes unrelated to the problem. Making a variable obsolete causes Emacs emit annoying messages when the variable is used, and that can be justified only if the variable gets in the way. This one doesn't. So I think we should just make the default value nil, and be done. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 15:25:03 2023 Received: (at 64311) by debbugs.gnu.org; 29 Jun 2023 19:25:03 +0000 Received: from localhost ([127.0.0.1]:54053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qExGJ-0004Ak-CC for submit@debbugs.gnu.org; Thu, 29 Jun 2023 15:25:03 -0400 Received: from robust-software.ca ([174.136.98.50]:17074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qExGG-00049t-W1 for 64311@debbugs.gnu.org; Thu, 29 Jun 2023 15:25:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=A4uKSliP86iT1 S2SH+Y42o9yDbmWurMmPXGYKwy4nec=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=jwoO3lJpL2RH0S18Zus0t7US69DPL9rkGZVVd LM3TIkPmSf0btqhhCBrRQt35HnlK4Bfw1p9UQMxdbuuJdGS34pSoIAfQEtSQsPil2kN3LE 9SwYuVl04LZ3JWGQL1NVjLooL+2bqrpaUGsCWXdLminqrki4+uQyt2F6LMql/C1I= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6xj57njf87zz1o.ipv6.telus.net [2001:56a:f913:3c01:6067:9d9:8a35:d32c]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id c4b3b2e4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 29 Jun 2023 12:24:59 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <83a5wita0p.fsf@gnu.org> Date: Thu, 29 Jun 2023 13:24:58 -0600 Message-ID: <87ttuqax6d.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > Am I? Asking about the root cause of the problem is not wrong, > because it indicates how best to fix it. The root cause of the problem is the redundant variable shell-dirtrackp, not its value. It is the variable aliasing in the 2018 commit 9c3eeba4db26ddaeead100beea7a96f9fa640918 that introduced the bug. This is why my patch addresses the root cause of the problem, instead of setting the value of the variable (which commit 9c3eeba4db26ddaeead100beea7a96f9fa640918 did not touch). > Why would we bother about that? With the exception of the default > value, what harm does that variable cause by existing? It is misleading for someone trying to customize shell-mode, or work on shell.el. I found it confusing on both counts. If it were not confusing for you too, we obviously would not be having such a long back-and-forth conversation about this bug. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 01:40:05 2023 Received: (at 64311) by debbugs.gnu.org; 30 Jun 2023 05:40:05 +0000 Received: from localhost ([127.0.0.1]:54364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qF6rU-0006bH-Ne for submit@debbugs.gnu.org; Fri, 30 Jun 2023 01:40:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qF6rS-0006ah-88 for 64311@debbugs.gnu.org; Fri, 30 Jun 2023 01:40:03 -0400 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 1qF6rM-0004Sm-LI; Fri, 30 Jun 2023 01:39:56 -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=qCgkoHl9Z6zpjZ5IiewgBDOoyog3MUsyzfnrnmhqs3Q=; b=BYnGBCNJ21Ce uegDOroC/QlzVUGIFmTsYYG+gvWIpvD10PCWmSNjm9LznbQTBG83Llr+aSBSgwCqiYGLsE1yL/yeb Cj4RyNg7CDdrtCdB24D2lw9VqV6G6uc0tPMq7VwPbcHR7607gGpzqb441MVaCo3tm6H0fh4QJN7Dk aZ3dk6jEZWOnWbGKkVz6gn5PsFWXYJsmeaC2RN+IFy1O295AuLDWkXgiL+TIRzccLXax3fG8r3SIh P4NJ3GR1hoeQBNwiNQYwUvqduMDFa/cFvVKuZJ4ZLhhhnExuDHIXd9XL5+8Y5V60be8QFfKiymG+h P5Uq75xIgz75OgMbA3i16A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qF6r8-0005UY-VK; Fri, 30 Jun 2023 01:39:50 -0400 Date: Fri, 30 Jun 2023 08:40:12 +0300 Message-Id: <835y75tsn7.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87ttuqax6d.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Thu, 29 Jun 2023 13:24:58 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Thu, 29 Jun 2023 13:24:58 -0600 > > > Eli Zaretskii writes: > > > Am I? Asking about the root cause of the problem is not wrong, > > because it indicates how best to fix it. > > The root cause of the problem is the redundant variable > shell-dirtrackp, not its value. It is the variable aliasing in the > 2018 commit 9c3eeba4db26ddaeead100beea7a96f9fa640918 that introduced > the bug. > > This is why my patch addresses the root cause of the problem, instead > of setting the value of the variable (which commit > 9c3eeba4db26ddaeead100beea7a96f9fa640918 did not touch). The variable's existence is only the cause of the problem because of its value. > > Why would we bother about that? With the exception of the default > > value, what harm does that variable cause by existing? > > It is misleading for someone trying to customize shell-mode, or work > on shell.el. I found it confusing on both counts. Such confusion can be prevented by adding appropriate comments. By contrast, removing the variable, or declaring it obsolete, is backward-incompatible change in behavior, which we try to avoid at all costs. In this case, I see absolutely no justification for such backward incompatibility. We wouldn't be able to defend such a change if it caused someone annoyance or, worse, breakage of their Emacs setup and usage. > If it were not confusing for you too, we obviously would not be > having such a long back-and-forth conversation about this bug. The discussion was long because I couldn't connect between the problem and the changes you proposed. The solution I thought about immediately was just to change the value of the variable. The rest was getting you to agree that such a change would indeed solve the problem (although you disagree it's the right solution). From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 12:47:12 2023 Received: (at 64311) by debbugs.gnu.org; 30 Jun 2023 16:47:12 +0000 Received: from localhost ([127.0.0.1]:55671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFHH6-0002op-AV for submit@debbugs.gnu.org; Fri, 30 Jun 2023 12:47:12 -0400 Received: from robust-software.ca ([174.136.98.50]:30461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFHH3-0002of-66 for 64311@debbugs.gnu.org; Fri, 30 Jun 2023 12:47:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=D6B5Fmj2i8jVo RQioHINZvjuWE2ZIIjIB8VEjBCySMQ=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=k3j7xJGc+AXL/ixUsINL3f6HAamv37fvyfttt nI/re5fJ27fce4aDUTWMDPxok6IwAFnsxRPc7h/2zHXvZhjxSwQTkaRMWGNFkpQ3sspdJ7 o61xh42ufMKBie35kHjCikxn6Th2EOSjgUV0dqkwhdEHCR/G74QaGS2Wp7/ttzsk= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6zk1mmpq1riwle.ipv6.telus.net [2001:56a:f913:3c01:e590:52ea:9935:f482]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id b78f070e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 30 Jun 2023 09:47:07 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <835y75tsn7.fsf@gnu.org> Date: Fri, 30 Jun 2023 10:47:05 -0600 Message-ID: <87r0ps7v92.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > The discussion was long because I couldn't connect between the problem > and the changes you proposed. The solution I thought about > immediately was just to change the value of the variable. The rest > was getting you to agree that such a change would indeed solve the > problem (although you disagree it's the right solution). The problem is not with the variable value, the problem is with the variable binding. If you look at shell.el right now, there are 3 places where the binding changes: 1. shell.el:349: defvaralias 'shell-dirtrack-mode 'shell-dirtrackp 2. shell.el:351: defvar shell-dirtrackp t 3. shell.el:1170: define-minor-mode shell-dirtrack-mode 1. assigns the alias 2. assigns a global binding type to shell-dirtrackp 3. assigns a buffer-local binding type to shell-dirtrackp If you look at 2, you don't see that shell-dirtrackp becomes buffer-local. If you look at 3, you don't see that shell-dirtrack-mode gets a default value. Where is the bug? Is it in step 1, 2, 3, or all of the above? Notice how the change in 9c3eeba4db26ddaeead100beea7a96f9fa640918 had another unintended effect: before the change, shell-dirtrackp would affect every shell-mode buffer; now setting the variable affects only the current buffer. Whether you consider that a bug or an "accidental improvement" is irrelevant. That commit was to fix compiler warnings, not to change global behavior. So this was far from obvious for Glenn Morris, and it's not obvious to you, and you are the Emacs maintainer. How is someone who is not an elisp expert supposed to figure this out? How are people supposed to avoid more bugs when touching this variable in future shell.el changes? > Such confusion can be prevented by adding appropriate comments. Obviously not in this case, because comments do not affect how variable bindings change. > By contrast, removing the variable, or declaring it obsolete, is > backward-incompatible change in behavior, which we try to avoid at all > costs. In this case, I see absolutely no justification for such > backward incompatibility. We wouldn't be able to defend such a change > if it caused someone annoyance or, worse, breakage of their Emacs > setup and usage. If you think the patch should do a defvaralias instead of a define-obsolete-variable-alias, that's fine. The reason I preferred to mark it obsolete is that variable aliases cause subtle bugs like this, and IMO are generally a bad idea. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 02 02:39:04 2023 Received: (at 64311) by debbugs.gnu.org; 2 Jul 2023 06:39:04 +0000 Received: from localhost ([127.0.0.1]:59068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFqjf-0006p8-Uw for submit@debbugs.gnu.org; Sun, 02 Jul 2023 02:39:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFqjc-0006od-P8 for 64311@debbugs.gnu.org; Sun, 02 Jul 2023 02:39:02 -0400 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 1qFqjX-0000is-Ad; Sun, 02 Jul 2023 02:38:55 -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=kq3K4tQ6ePzLwG9sJ1DUWYgy6cxxLqumZeTP2CIv6dQ=; b=ZOQ0sgxjtuep WHH2/bmRL6O6z8jDTr/NaGULxLZV7eB+JYTub0NW9+k2ArB4Km7/hHOlUyJj3fAZl1LFqXKfLiVEP jFWZds18e5yYtubfO1k01YMdItOlN1ApsoY51F4u23O46GqfsCAR9lnnUH50UtucCqdohExwOgLs0 BNUCd4DGxPQRUw7oDvZxrS9JlE+htdSQMhQVjcg9uq4l0omM/jNaDKpDV2dK8XyoDCZVqE7/5ih6I jCkxrC1K4E+dEaxDbC1FtMlHK22LlntSFCoMBF2JHUgagtPJXYsX3jkpjffpbaPWlAKc/OHRkx56G oqP1D/HBvNmGijJg4ARixA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFqjW-0005Yx-Od; Sun, 02 Jul 2023 02:38:55 -0400 Date: Sun, 02 Jul 2023 09:39:28 +0300 Message-Id: <831qhqq0kf.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <87r0ps7v92.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Fri, 30 Jun 2023 10:47:05 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Fri, 30 Jun 2023 10:47:05 -0600 > > The problem is not with the variable value, the problem is with the > variable binding. > > If you look at shell.el right now, there are 3 places where the > binding changes: > > 1. shell.el:349: defvaralias 'shell-dirtrack-mode 'shell-dirtrackp > 2. shell.el:351: defvar shell-dirtrackp t > 3. shell.el:1170: define-minor-mode shell-dirtrack-mode > > 1. assigns the alias > 2. assigns a global binding type to shell-dirtrackp > 3. assigns a buffer-local binding type to shell-dirtrackp > > If you look at 2, you don't see that shell-dirtrackp becomes > buffer-local. If you look at 3, you don't see that > shell-dirtrack-mode gets a default value. I think the alternative patch below solves all those issues. If you disagree, pleased tell what left-over problems you see after applying that patch. > Notice how the change in 9c3eeba4db26ddaeead100beea7a96f9fa640918 had > another unintended effect: before the change, shell-dirtrackp would > affect every shell-mode buffer; now setting the variable affects only > the current buffer. Whether you consider that a bug or an "accidental > improvement" is irrelevant. That commit was to fix compiler warnings, > not to change global behavior. I think this change is for the better, and the 5 years since that change seem to at least tell us it had no negative effects on users. And your proposed patch AFAICT does nothing to change this aspect of that old commit, does it? > > By contrast, removing the variable, or declaring it obsolete, is > > backward-incompatible change in behavior, which we try to avoid at all > > costs. In this case, I see absolutely no justification for such > > backward incompatibility. We wouldn't be able to defend such a change > > if it caused someone annoyance or, worse, breakage of their Emacs > > setup and usage. > > If you think the patch should do a defvaralias instead of a > define-obsolete-variable-alias, that's fine. shell.el already uses defvaralias. > The reason I preferred to mark it obsolete is that variable aliases > cause subtle bugs like this, and IMO are generally a bad idea. It's too late for such considerations, since this alias has been with us for many years, and it is quite possible some users depend on it in their setups. So changes that don't break their setups are preferable. Here's the patch I propose: diff --git a/lisp/shell.el b/lisp/shell.el index 5cf108b..4bbd295 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -348,8 +348,10 @@ shell-dirstack (defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) -(defvar shell-dirtrackp t - "Non-nil in a shell buffer means directory tracking is enabled.") +(defvar-local shell-dirtrackp nil + "Non-nil in a shell buffer means directory tracking is enabled. +Directory tracking (`shell-dirtrack-mode') is automatically enabled +when `shell-mode' is activated.") (defvar shell-last-dir nil "Keep track of last directory for ksh `cd -' command.") @@ -1129,6 +1131,7 @@ shell-extract-num (define-minor-mode shell-dirtrack-mode "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). +This assigns a buffer-local non-nil value to `shell-dirtrackp'. The `dirtrack' package provides an alternative implementation of this feature; see the function `dirtrack-mode'. Also see From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 03 13:03:45 2023 Received: (at 64311) by debbugs.gnu.org; 3 Jul 2023 17:03:45 +0000 Received: from localhost ([127.0.0.1]:34390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGMxl-0007Q2-2s for submit@debbugs.gnu.org; Mon, 03 Jul 2023 13:03:45 -0400 Received: from robust-software.ca ([174.136.98.50]:4820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGMxh-0007Ps-Ni for 64311@debbugs.gnu.org; Mon, 03 Jul 2023 13:03:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=bSWiT9RDyfDwo n6wLre6Rq19u61gIB2Ea6SP4moxFFQ=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=eNI2dWLT/k0PpTbVL+Z5jSRk6AzhJo52EVyi1 o1hF7XdFXMGeGzWunn6QsQkgIqe0WO4bViUovgL9jgWaYYK2xa2uGiey1VsTbdi6sfzBwn UPerUMXLkpSiF8vjYhW/Sm0yD//wsoLqeZCEP8992DiTD97P1YduCX3DDe8Xypo4= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6xrruvejpf19h4.ipv6.telus.net [2001:56a:f913:3c01:702a:1815:9e78:938]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 416f637f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 3 Jul 2023 10:03:39 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <831qhqq0kf.fsf@gnu.org> Date: Mon, 03 Jul 2023 11:03:37 -0600 Message-ID: <87zg4dsz9y.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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 (-) Eli Zaretskii writes: > I think the alternative patch below solves all those issues. If you > disagree, pleased tell what left-over problems you see after applying > that patch. How should defvaralias be used? On the master branch I count 74 defvaralias declarations in lisp/, excluding lisp/obsolete/ (there are some more generated dynamically by org-babel). Of these, 73 are used for variable rename refactoring (the 1 other use is vhdl-last-input-event as a compatibility shim for xemacs). There were 2 things that to me looked wrong with the existing defvaralias declaration in shell.el: 1. As far as I can tell, every declaration aside from shell.el is of the form (defvaralias old-variable new-variable). The one in shell.el is the other way around. 2. There are only 2 occurrences where the old variable is still referenced in Emacs code: erc-join-buffer and shell-dirtrackp Isn't the point of defvaralias in removing uses of the old variable name from Emacs code? -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 03 13:17:04 2023 Received: (at 64311) by debbugs.gnu.org; 3 Jul 2023 17:17:04 +0000 Received: from localhost ([127.0.0.1]:34403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGNAd-0007kf-VU for submit@debbugs.gnu.org; Mon, 03 Jul 2023 13:17:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGNAb-0007k7-Hp for 64311@debbugs.gnu.org; Mon, 03 Jul 2023 13:17:02 -0400 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 1qGNAV-00015c-OC; Mon, 03 Jul 2023 13:16:55 -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=u/2Zpt1RA7tRPp8oKCv9jOYuhJmZRuoocf29pgGtbyU=; b=L3XwTnYkPXXE yOEf/LK2VmRqZWmqxleW9nK+sVy3ZuLtYR3a50n5WabBASY2qGd/bk292FF5VLpaa6khlNgRZ7VmG NpguXvtPmp61uqgM/T1W6iQPMgF6zDIg1Tu3jQhT0s66e4OcqeYTQpCEX0YYiIHg0Lv03XDaAjQ7H 7smcP+GEG1Og8Yki8teG8wmeRTT90Hgc6P0C1Uos5V7coVeo+Kh+LyjqUsJgBMnYq6WN9STZvncW0 2HMCGtzzhm1hdic5EZz9kwEfVCysnaGhzTF0ZNrP3NHcKs3DtFMTN9lD3SUS4ixrXGnH8tw0adXS7 pWCmE+WDF+rySdS1Qxt6Mg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGNAV-0005uV-8t; Mon, 03 Jul 2023 13:16:55 -0400 Date: Mon, 03 Jul 2023 20:17:31 +0300 Message-Id: <838rbwncd0.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach , Stefan Monnier In-Reply-To: <87zg4dsz9y.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Mon, 03 Jul 2023 11:03:37 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <87zg4dsz9y.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311@debbugs.gnu.org > Date: Mon, 03 Jul 2023 11:03:37 -0600 > > > Eli Zaretskii writes: > > I think the alternative patch below solves all those issues. If you > > disagree, pleased tell what left-over problems you see after applying > > that patch. > > How should defvaralias be used? > > On the master branch I count 74 defvaralias declarations in lisp/, > excluding lisp/obsolete/ (there are some more generated dynamically > by org-babel). Of these, 73 are used for variable rename refactoring > (the 1 other use is vhdl-last-input-event as a compatibility shim for > xemacs). > > There were 2 things that to me looked wrong with the existing > defvaralias declaration in shell.el: > > 1. As far as I can tell, every declaration aside from shell.el is of > the form (defvaralias old-variable new-variable). The one in > shell.el is the other way around. > > 2. There are only 2 occurrences where the old variable is still > referenced in Emacs code: erc-join-buffer and shell-dirtrackp > > Isn't the point of defvaralias in removing uses of the old variable > name from Emacs code? I'm not sure. You may be right. Let's see if Stefan (CC'ed) has any comments. But in any case, given how long we have this arrangement, I wouldn't make any changes in it unless it causes real problems. And I think after installing the simple changes I proposed there are no real problems left to justify such changes. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 03 23:33:01 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 03:33:01 +0000 Received: from localhost ([127.0.0.1]:34802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGWmj-0007cp-FU for submit@debbugs.gnu.org; Mon, 03 Jul 2023 23:33:01 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGWmf-0007ca-Ag for 64311@debbugs.gnu.org; Mon, 03 Jul 2023 23:33:00 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 95F744425CF; Mon, 3 Jul 2023 23:32:51 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 010834425CA; Mon, 3 Jul 2023 23:32:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688441570; bh=bdtGXtMg6NNO1LpiZD6VlQtciGurz61iu3+6ugcnTP4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HMo71RLkC72bFZxzkpTrKj5jvQq0uy/pvsdXKHmKVDrPCwsDxTsAX/RndmDY1LNCx 08KNrc9aA8rmCcUBIpUA7sKXoMkJYPV6JTQtYQrgQTUt4KGsfqFi9pUuiy3ZOvxz6C r68EyMuULHqc0L/wph26JKAWI9q0uOsMbfDPWW6SZgqCp+iu/8T3dX0Y0orWDBH5Cq RWm/4VSipeg2FSn+BpEZtxOFcBEKVJJB3UgWMsZvGWOgCK3eFHQzHFmFViP/+jEmtW POJR3EArGMN0PoG8LVoaJhSy5mQFQTAe7+XFhP6OW9j82g7bVnz6Gy9uFghFTLk2dj W/qBx9gdhIxnQ== Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CDA58120205; Mon, 3 Jul 2023 23:32:49 -0400 (EDT) From: Stefan Monnier To: Vladimir Sedach Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-Reply-To: <87pm5h4iy1.fsf@t510.orion.oneofus.la> (Vladimir Sedach's message of "Mon, 26 Jun 2023 22:39:50 -0600") Message-ID: References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> Date: Mon, 03 Jul 2023 23:32:49 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.070 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org 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: -3.3 (---) > diff --git a/lisp/shell.el b/lisp/shell.el > index b74442f1961..39e12577280 100644 > --- a/lisp/shell.el > +++ b/lisp/shell.el > @@ -346,10 +346,10 @@ shell-dirstack > "List of directories saved by pushd in this buffer's shell. > Thus, this does not include the shell's current directory.") > > -(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) > - > -(defvar shell-dirtrackp t > - "Non-nil in a shell buffer means directory tracking is enabled.") > +(define-obsolete-variable-alias 'shell-dirtrackp 'shell-dirtrack-mode > + "???" > + "Non-nil in a shell buffer means directory tracking is enabled. > +Use the minor mode variable `shell-dirtrack-mode' instead.") Indeed `shell-dirtrackp` should not be defvar'd. The above looks good to me. > @@ -997,6 +997,20 @@ shell > ;; replace it with a process filter that watches for and strips out > ;; these messages. > > +(define-minor-mode shell-dirtrack-mode > + "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). > + > +The `dirtrack' package provides an alternative implementation of > +this feature; see the function `dirtrack-mode'. Also see > +`comint-osc-directory-tracker' for an escape-sequence based > +solution." > + :lighter nil > + :interactive (shell-mode) > + (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) > + (if shell-dirtrack-mode > + (add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t) > + (remove-hook 'comint-input-filter-functions #'shell-directory-tracker t))) You can make the patch smaller by keeping this definition where it is and just add a (defvar shell-dirtrack-mode) here instead to silence the compiler warnings. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 07:21:12 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 11:21:12 +0000 Received: from localhost ([127.0.0.1]:35082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGe5n-0006K8-OU for submit@debbugs.gnu.org; Tue, 04 Jul 2023 07:21:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGe5i-0006JT-Qv for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 07:21:09 -0400 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 1qGe5d-0000zk-0u; Tue, 04 Jul 2023 07:21:01 -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=8993ox9P3fOYS92aS/hA9c/UnVG48Orltfr9rXgX+PA=; b=RlKqMxz3C+HM Dg7cCWm1WFYCppvjRrL/uhxQubHzEE2D1md74iryIsflBwACEcocLYS6MeeiN97eIzIxLq4dTFPlM 1Jr6JmxPLmgWUeEz1wJbNgNNXRQa7exfNXpmTq9YoyL1/yNTA5o/gcXTFcPpUlG3SIaQzxYFSFI1L 9srL/gBxRLrjwH7BdGwhUbnCyqRVv76s+L1i2TT2OGJynSaVW4KAzQqUqZANn0D2TY0SWxDsZjfGx RXe6WolFJB1RPzFkKFy7pujm723oABcqEfAb8lleDv3cjsHa3vAidyA5+0ZUtMFCQC8oc10vae+jU F0RIoWQKD4debFcvOPShCA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGe5c-0002Nw-H8; Tue, 04 Jul 2023 07:21:00 -0400 Date: Tue, 04 Jul 2023 14:21:39 +0300 Message-Id: <83wmzfly64.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, vas@oneofus.la 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: -3.3 (---) > Cc: 64311@debbugs.gnu.org > Date: Mon, 03 Jul 2023 23:32:49 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > diff --git a/lisp/shell.el b/lisp/shell.el > > index b74442f1961..39e12577280 100644 > > --- a/lisp/shell.el > > +++ b/lisp/shell.el > > @@ -346,10 +346,10 @@ shell-dirstack > > "List of directories saved by pushd in this buffer's shell. > > Thus, this does not include the shell's current directory.") > > > > -(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) > > - > > -(defvar shell-dirtrackp t > > - "Non-nil in a shell buffer means directory tracking is enabled.") > > +(define-obsolete-variable-alias 'shell-dirtrackp 'shell-dirtrack-mode > > + "???" > > + "Non-nil in a shell buffer means directory tracking is enabled. > > +Use the minor mode variable `shell-dirtrack-mode' instead.") > > Indeed `shell-dirtrackp` should not be defvar'd. > The above looks good to me. It doesn't look good to me, for the reasons I explained in the discussion. Do you see anything wrong with the alternative patch I proposed instead? From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 10:29:12 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 14:29:12 +0000 Received: from localhost ([127.0.0.1]:36402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGh1k-0005lX-16 for submit@debbugs.gnu.org; Tue, 04 Jul 2023 10:29:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGh1e-0005kz-Kx for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 10:29:09 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2FE42100099; Tue, 4 Jul 2023 10:29:01 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ADD74100048; Tue, 4 Jul 2023 10:28:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688480935; bh=CUqaUo7e98AwwekGR6bVHOXyxwBv/xqGg0Km4GfwtYI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ebflnzabzFDRKIFViMMJvL+/BP2JlDM+KVivnFHj2BDnP2y41FRurJuUR6LlSMCmg 1Im7jZ2SfB6ldBqDYSCt5h5t60FPm1Rn7jX1AR3tT6k+NyXLk8ESdbqKnAYDVM76UM +90ptEMYNVUHnpNxA2SP4loSZhF2rPZHAy+wc3DRxglDAsH3xKnTeeICTLxQ+o7mUj RCohRUy1hAQ+sUNJa++8mFDk55RLYtonYlcijB5Ulu5njK1c6vxDGfy3l+OuAdl+L3 XMXpvZGLrsF3LFEiWjPcJmwQ4XSfwALS0gmCwyQ2beiN6sUJataxKcy2snmMqGhloA UK9v57elRW1FA== Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8A382120195; Tue, 4 Jul 2023 10:28:55 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-Reply-To: <831qhqq0kf.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 02 Jul 2023 09:39:28 +0300") Message-ID: References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> Date: Tue, 04 Jul 2023 10:28:55 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.222 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, Vladimir Sedach 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: -3.3 (---) FWIW, my take on the root cause is that I made a mistake in commit 05327ca9724287cc3da4c625f180da5ab11be998 where I forgot to remove the `defvar` of `shell-dirtrackp` (and I swapped the args to `defvaralias`). It's fundamentally wrong to define a variable at 2 places. > diff --git a/lisp/shell.el b/lisp/shell.el > index 5cf108b..4bbd295 100644 > --- a/lisp/shell.el > +++ b/lisp/shell.el > @@ -348,8 +348,10 @@ shell-dirstack > > (defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) > > -(defvar shell-dirtrackp t > - "Non-nil in a shell buffer means directory tracking is enabled.") > +(defvar-local shell-dirtrackp nil > + "Non-nil in a shell buffer means directory tracking is enabled. > +Directory tracking (`shell-dirtrack-mode') is automatically enabled > +when `shell-mode' is activated.") > > (defvar shell-last-dir nil > "Keep track of last directory for ksh `cd -' command.") > @@ -1129,6 +1131,7 @@ shell-extract-num > > (define-minor-mode shell-dirtrack-mode > "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). > +This assigns a buffer-local non-nil value to `shell-dirtrackp'. > > The `dirtrack' package provides an alternative implementation of > this feature; see the function `dirtrack-mode'. Also see This aligns the `defvar` of `shell-dirtrackp` with that of `shell-dirtrack-mode`, which reduces the harm of the duplication, so it fixes the worst part of my mess, thanks. I'd prefer the original patch, tho, which should give basically the same end result but without this weird duplicate definition. I assume we're discussing this patch for `master`, not `emacs-29`, right? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 12:05:20 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 16:05:20 +0000 Received: from localhost ([127.0.0.1]:36467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGiWm-0007hc-Fq for submit@debbugs.gnu.org; Tue, 04 Jul 2023 12:05:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGiWi-0007hF-2w for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 12:05:19 -0400 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 1qGiWc-0002jj-5U; Tue, 04 Jul 2023 12:05:10 -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=QCvX5UzTh1W8IuMnQalcBPXhqiH9JcdIg5kf3u21c+4=; b=eqn2vRDc6TIz xZHc0wrgMyBXpkOOZjqS4AEQB11uTve1uZ+yLFb5holIrXyPs4T6y+T6Xy7J8pZ9bWXTpMN66yi+Y +XWxfBwb6pM/ZPL+ZtJdr5ajJXYKOQmXwz0xqCU4z+47HsLh3mGU/RzasozmJGzMOUuA81Qqbl0zp rNWEyS4kds8cYxbI7m0RYpR9U/nxDSnHuJoFFmflWtwplIk0cD98Ns23G7vaSSRo309ffH8IJpjnf kiWI9QGwYNhWYwkN055DgyrcdZ4T9gU9yAIK+YZQ3rUGBPR41zhGXKegcC1+PRTPcxKd2SlwThdJg kx/9wk/fQmpnBPulEOhiHQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGiWZ-0005pd-C2; Tue, 04 Jul 2023 12:05:09 -0400 Date: Tue, 04 Jul 2023 19:05:02 +0300 Message-Id: <837crfll1t.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 04 Jul 2023 10:28:55 -0400) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, vas@oneofus.la 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: -3.3 (---) > From: Stefan Monnier > Cc: Vladimir Sedach , 64311@debbugs.gnu.org > Date: Tue, 04 Jul 2023 10:28:55 -0400 > > FWIW, my take on the root cause is that I made a mistake in commit > 05327ca9724287cc3da4c625f180da5ab11be998 where I forgot to remove the > `defvar` of `shell-dirtrackp` (and I swapped the args to `defvaralias`). The problem here for me is that this mistake was made long ago, and by now there could be people out there who actually rely on this problematic alias. > > diff --git a/lisp/shell.el b/lisp/shell.el > > index 5cf108b..4bbd295 100644 > > --- a/lisp/shell.el > > +++ b/lisp/shell.el > > @@ -348,8 +348,10 @@ shell-dirstack > > > > (defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) > > > > -(defvar shell-dirtrackp t > > - "Non-nil in a shell buffer means directory tracking is enabled.") > > +(defvar-local shell-dirtrackp nil > > + "Non-nil in a shell buffer means directory tracking is enabled. > > +Directory tracking (`shell-dirtrack-mode') is automatically enabled > > +when `shell-mode' is activated.") > > > > (defvar shell-last-dir nil > > "Keep track of last directory for ksh `cd -' command.") > > @@ -1129,6 +1131,7 @@ shell-extract-num > > > > (define-minor-mode shell-dirtrack-mode > > "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). > > +This assigns a buffer-local non-nil value to `shell-dirtrackp'. > > > > The `dirtrack' package provides an alternative implementation of > > this feature; see the function `dirtrack-mode'. Also see > > This aligns the `defvar` of `shell-dirtrackp` with that of > `shell-dirtrack-mode`, which reduces the harm of the duplication, so > it fixes the worst part of my mess, thanks. > > I'd prefer the original patch, tho, which should give basically the same > end result but without this weird duplicate definition. The original patch makes a backward-incompatible change, which for me is a significant disadvantage. > I assume we're discussing this patch for `master`, not `emacs-29`, right? Yes. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 14:34:56 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 18:34:56 +0000 Received: from localhost ([127.0.0.1]:36614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGkrX-0006VT-RV for submit@debbugs.gnu.org; Tue, 04 Jul 2023 14:34:56 -0400 Received: from robust-software.ca ([174.136.98.50]:34086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGkrU-0006VH-H3 for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 14:34:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=TvWIGD5iAGFoV BrmQWTrw/mYVJ19Ebwy3LnRCYcA/nI=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=BoKMd2Y1ViJQnEeLCYMl0tOP5+5qLI9Sy6v7Y PWwvDS4SPYNfpEK28VPhsnREgVIDQXme311r5CmyYFYsi5GI8/2HR9FQXfT4LXIrPIAraS 6zmvqMEyDmo7dMhZ4E58mYF2sMN60KdpWJ2c7UyxUB7TsYctOo1sAEhYbEuevnmk= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6zaltcxz5mrzic.ipv6.telus.net [2001:56a:f913:3c01:d452:6522:e002:6684]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 098d692d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 4 Jul 2023 11:34:50 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <837crfll1t.fsf@gnu.org> Date: Tue, 04 Jul 2023 12:34:49 -0600 Message-ID: <87jzvffrue.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, Stefan Monnier 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 (-) Eli Zaretskii writes: > The original patch makes a backward-incompatible change, which for me > is a significant disadvantage. I think we are all in agreement now about keeping the defvaralias, and not deprecating anything. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 16:36:15 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 20:36:15 +0000 Received: from localhost ([127.0.0.1]:36689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGmkx-0001Wu-0i for submit@debbugs.gnu.org; Tue, 04 Jul 2023 16:36:15 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGmks-0001WV-CZ for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 16:36:13 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 124EC4425E4; Tue, 4 Jul 2023 16:36:05 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 981104425DA; Tue, 4 Jul 2023 16:36:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688502963; bh=74wF3Jdj7ce8IfzOIRRPHKR8svmrxlA4Kmpw+pZ420g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ksGizQPEcTaSfX+SMuRwLBhOsbVyk+8UJdf8eSf4BKg/4ifvzHmbNA7SK35GH5W97 1UbwqwSbersb5xkLC/lt63lJmzBg5fLyoVsPS/l3maCKNQPXs9xKDBLbh2cVsG0ycB yQ4WNtdtlQMfiydM6JKmuqDDPcHYvt/mFhMFi8MMwXID+9Iqrb7GZitmiB0cK1yW/E Hh4+U6Ss6T5RqpTXlJl8lYl1Mn2GAMxQgkqLmAzzvaxJn1KRXy5u7xR8KACJUgfX6l 4ixCXbvHCi0Knl1vd6x6rGOHVtaAo2eA5zpS4iPoFRi+ADBsI8trswUnixbQmiRuV8 kEhocXX/N4/XQ== Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6DE6E1202A5; Tue, 4 Jul 2023 16:36:03 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-Reply-To: <837crfll1t.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Jul 2023 19:05:02 +0300") Message-ID: References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> Date: Tue, 04 Jul 2023 16:36:01 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, vas@oneofus.la 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: -3.3 (---) >> FWIW, my take on the root cause is that I made a mistake in commit >> 05327ca9724287cc3da4c625f180da5ab11be998 where I forgot to remove the >> `defvar` of `shell-dirtrackp` (and I swapped the args to `defvaralias`). > > The problem here for me is that this mistake was made long ago, and by > now there could be people out there who actually rely on this > problematic alias. None of the patches I've seen remove the alias, AFAICT. Some reverse the direction but I'm hard pressed to imagine a way for code to be affected by this (unless they call `indirect-variable`, obviously). > The original patch makes a backward-incompatible change, which for me > is a significant disadvantage. I don't know what backward-incompatible you're referring to. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 18:27:22 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 22:27:22 +0000 Received: from localhost ([127.0.0.1]:36751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGoUU-0004eH-73 for submit@debbugs.gnu.org; Tue, 04 Jul 2023 18:27:22 -0400 Received: from robust-software.ca ([174.136.98.50]:8584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGoUS-0004e8-9Y for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 18:27:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=38q++B+xCl3sd QZNtuM2NTcezmBulADHd/IzyxUPt4A=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=nK5bnS4ZX4FEQTWEQzkjuY/8UPPTWgFmUKbgU X5B+w4h2I/5D+RXZTQQzUaDah0hHHQbZEgDS9YiwaCFyiX0Gb0HpmxFO9X+fw3DrhbDKZF cdGdIMowSev6lKrp8hCMZ4j0bdd4/TeRePUa9CkMtL68ltihWA6QRCIXAtAUrg+Y= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6zaltcxz5mrzic.ipv6.telus.net [2001:56a:f913:3c01:d452:6522:e002:6684]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id e820925d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 4 Jul 2023 15:27:18 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Stefan Monnier Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: Date: Tue, 04 Jul 2023 16:27:17 -0600 Message-ID: <87h6qjfh2y.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, Eli Zaretskii 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 (-) Stefan Monnier writes: > I don't know what backward-incompatible you're referring to. I wanted to replace the defvaralias with define-obsolete-variable-alias, and Eli says that shell-dirtrackp should not be marked obsolete, which makes sense. -- Vladimir Sedach From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 19:42:47 2023 Received: (at 64311) by debbugs.gnu.org; 4 Jul 2023 23:42:47 +0000 Received: from localhost ([127.0.0.1]:36802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGpfT-0006Wo-3L for submit@debbugs.gnu.org; Tue, 04 Jul 2023 19:42:47 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:1483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGpfO-0006WY-Et for 64311@debbugs.gnu.org; Tue, 04 Jul 2023 19:42:45 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D220B8004C; Tue, 4 Jul 2023 19:42:36 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 44FCB805DB; Tue, 4 Jul 2023 19:42:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688514151; bh=njVLbePjtO4ldt5tmhg3I2OhkASNkHgHOtdFAXDG3Y8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=gYfTL7MVgBCa53zj3Og8CRp/kJTAFwfxpyRp2YQdbSs/HBHnWKOyyP+M2IkHWqoO1 3mm/5M+pcetAvfT3+AM2SGd97TCjFFhADimPGZWhh6l9JRzvq5ikR5DUGPybvy0C7I xDezauDBF/1hMM3mGju2FexfAGEGc9KyKZAxtQgDL8bdFkPMqdWMjttphHUu0NZLRh u3F/qmNy69xvogrMD971xMIFjRfBDReiy75xtI2Ji31T98FiU5qXJZqVHG/QcssZY8 O2LsMn1/g3SWb8RIyD7k/CLuM9wf1p0y35kicm9xc3vvkSKPFeWYQXWr+JMf53Ltas r2v4rY6pwRSOw== Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1BADC12016F; Tue, 4 Jul 2023 19:42:31 -0400 (EDT) From: Stefan Monnier To: Vladimir Sedach Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-Reply-To: <87h6qjfh2y.fsf@t510.orion.oneofus.la> (Vladimir Sedach's message of "Tue, 04 Jul 2023 16:27:17 -0600") Message-ID: References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> <87h6qjfh2y.fsf@t510.orion.oneofus.la> Date: Tue, 04 Jul 2023 19:42:30 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.071 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, Eli Zaretskii 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: -3.3 (---) Vladimir Sedach [2023-07-04 16:27:17] wrote: > Stefan Monnier writes: >> I don't know what backward-incompatible you're referring to. > I wanted to replace the defvaralias with > define-obsolete-variable-alias, `define-obsolete-variable-alias` includes `defvaralias`. It just adds an obsolescence warning, but doesn't introduce any actual changes in behavior. > and Eli says that shell-dirtrackp should not be marked obsolete, which > makes sense. Not sure if it makes sense, but if that's his preference, it's OK with me (the name `shell-dirtrackp` is fundamentally wrong since it's a boolean variable and not a predicate (which is where the "p" suffix is used), but I can live with it). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 06 16:30:23 2023 Received: (at 64311) by debbugs.gnu.org; 6 Jul 2023 20:30:23 +0000 Received: from localhost ([127.0.0.1]:42124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHVcM-0000EA-RH for submit@debbugs.gnu.org; Thu, 06 Jul 2023 16:30:23 -0400 Received: from robust-software.ca ([174.136.98.50]:2568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHVcJ-0000Dx-1y for 64311@debbugs.gnu.org; Thu, 06 Jul 2023 16:30:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=FeS4DHtRKFfio jCcva9S4UR2ft/QN8Mnp5/JKKF7rhA=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=Jdgzyg+ajy/e8DdUT5MZ5qmy+lIcHPp7nVgXR WyiusEymtcM4ksnffBAfu09y7epZ7LXi3DbDRYyIsYdOThTBJ+q0+dc96KV0aBE+xXrEB5 9X22xqQ17Aw7+qsc5AJbEiaDjZJl7/Sf6cY0hoWc7yc0bZ3gqHbfrgtXS1+FdZV8= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6wfx48h3rdwwcc.ipv6.telus.net [2001:56a:f913:3c01:18c0:ef97:141b:54bc]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id 95503d41 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 6 Jul 2023 13:30:17 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> <87h6qjfh2y.fsf@t510.orion.oneofus.la> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Stefan Monnier Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: Date: Thu, 06 Jul 2023 14:30:16 -0600 Message-ID: <878rbspyuf.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311 Cc: 64311@debbugs.gnu.org, Eli Zaretskii 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 (-) --=-=-= Content-Type: text/plain Attached is a patch that keeps defvaralias, and does not obsolete anything. -- Vladimir Sedach --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0002-Fix-shell-dirtrack-mode-showing-up-as-enabled-in-unr.patch Content-Transfer-Encoding: quoted-printable >From 9edd92e6e2763f5e2d7bf6dc5009ce857f3d36ae Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Mon, 26 Jun 2023 22:32:07 -0600 Subject: [PATCH 2/2] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit ; shell-dirtrack-mode always shows up in unrelated buffers. ; Steps to reproduce: ; 1. emacs -q ; 2. M-x shell ; 3. M-: shell-dirtrack-mode in *scratch* or *GNU Emacs* ; This is because shell-dirtrack-mode is aliased to shell-dirtrackp, ; which has default value t. ; Changes in this patch: ; remove redundant declaration of shell-dirtrackp ; replace existing occurrences of shell-dirtrackp with shell-dirtrack-mode ; add :interactive (shell-mode) suggestion to shell-dirtrack-mode ; shell-dirtrack-mode is still turned on by default. There is an ; explicit call to (shell-dirtrack-mode 1) in the definition of ; shell-mode. ; Definition of shell-dirtrack-mode is moved to quiet warning about ; reference to free variable =E2=80=98shell-dirtrack-mode=E2=80=99. --- lisp/shell.el | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lisp/shell.el b/lisp/shell.el index b74442f1961..47e7fa4b535 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -346,10 +346,9 @@ shell-dirstack "List of directories saved by pushd in this buffer's shell. Thus, this does not include the shell's current directory.") =20 -(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) - -(defvar shell-dirtrackp t - "Non-nil in a shell buffer means directory tracking is enabled.") +(defvaralias 'shell-dirtrackp 'shell-dirtrack-mode + "Non-nil in a shell buffer means directory tracking is enabled. +Superseded by the minor mode variable `shell-dirtrack-mode'.") =20 (defvar shell-last-dir nil "Keep track of last directory for ksh `cd -' command.") @@ -997,6 +996,20 @@ shell ;; replace it with a process filter that watches for and strips out ;; these messages. =20 +(define-minor-mode shell-dirtrack-mode + "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). + +The `dirtrack' package provides an alternative implementation of +this feature; see the function `dirtrack-mode'. Also see +`comint-osc-directory-tracker' for an escape-sequence based +solution." + :lighter nil + :interactive (shell-mode) + (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) + (if shell-dirtrack-mode + (add-hook 'comint-input-filter-functions #'shell-directory-tracker n= il t) + (remove-hook 'comint-input-filter-functions #'shell-directory-tracker = t))) + (defun shell-directory-tracker (str) "Tracks cd, pushd and popd commands issued to the shell. This function is called on each input passed to the shell. @@ -1013,7 +1026,7 @@ shell-directory-tracker and `shell-pushd-dunique' control the behavior of the relevant command. =20 Environment variables are expanded, see function `substitute-in-file-name'= ." - (if shell-dirtrackp + (if shell-dirtrack-mode ;; We fail gracefully if we think the command will fail in the shell. ;;; (with-demoted-errors "Directory tracker failure: %s" ;; This fails so often that it seems better to just ignore errors (?= ). @@ -1167,23 +1180,10 @@ shell-extract-num (and (string-match "^\\+[1-9][0-9]*$" str) (string-to-number str))) =20 -(define-minor-mode shell-dirtrack-mode - "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). - -The `dirtrack' package provides an alternative implementation of -this feature; see the function `dirtrack-mode'. Also see -`comint-osc-directory-tracker' for an escape-sequence based -solution." - :lighter nil - (setq list-buffers-directory (if shell-dirtrack-mode default-directory)) - (if shell-dirtrack-mode - (add-hook 'comint-input-filter-functions #'shell-directory-tracker n= il t) - (remove-hook 'comint-input-filter-functions #'shell-directory-tracker = t))) - (defun shell-cd (dir) "Do normal `cd' to DIR, and set `list-buffers-directory'." (cd dir) - (if shell-dirtrackp + (if shell-dirtrack-mode (setq list-buffers-directory default-directory))) =20 (defun shell-resync-dirs () --=20 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 04:30:32 2023 Received: (at 64311-done) by debbugs.gnu.org; 8 Jul 2023 08:30:32 +0000 Received: from localhost ([127.0.0.1]:44259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qI3Kq-0007fv-IM for submit@debbugs.gnu.org; Sat, 08 Jul 2023 04:30:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qI3Km-0007fd-1o for 64311-done@debbugs.gnu.org; Sat, 08 Jul 2023 04:30:31 -0400 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 1qI3Kf-0003i7-Pv; Sat, 08 Jul 2023 04:30:22 -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=iHeeDh8hQBCDG9kw7VWdF0Y+cOG8yPiH0ENYWtqyxFs=; b=UADJRpTZrL+o p2sZdeeLb7tmiwFgAzGAIp4lpzH31zWbHP2NLA4N4SJ9Y4jFzF9SZNLdL7fsgviUOg4BQs4Mdvetu vhwqGA39HJjlASU4kcunrp9UUjAWiyqMPbzcvibsHy+1eTZZ7IHhQ+XkolYGsBj/wK70pHU/W3Tlg AdVf6aHSghwWiXd3w9oUEVmJXTWbiLiaZwBEvGWO8l41QMVmlSE5ayy+BqposvNHtSI5fOgb9NkaU VedTL7gcktUbKJB0wzk5412pP46BOWXYkRjKifMQ2zh71dltLq3AEIoNmimJ+hiXKtKHUcwiJ9fsI 491NkPLVllcDSoRFjRF4dw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qI3Ke-0004CC-Vs; Sat, 08 Jul 2023 04:30:21 -0400 Date: Sat, 08 Jul 2023 11:30:25 +0300 Message-Id: <83r0pidcv2.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <878rbspyuf.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Thu, 06 Jul 2023 14:30:16 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <83h6qtw3tq.fsf@gnu.org> <87wmzp2e0d.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> <87h6qjfh2y.fsf@t510.orion.oneofus.la> <878rbspyuf.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311-done Cc: 64311-done@debbugs.gnu.org, monnier@iro.umontreal.ca 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: -3.3 (---) > From: Vladimir Sedach > Cc: Eli Zaretskii , 64311@debbugs.gnu.org > Date: Thu, 06 Jul 2023 14:30:16 -0600 > > Attached is a patch that keeps defvaralias, and does not obsolete > anything. Thanks, I installed this, with slight changes, on the master branch, and I'm therefore closing this bug. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 12:18:47 2023 Received: (at 64311-done) by debbugs.gnu.org; 8 Jul 2023 16:18:47 +0000 Received: from localhost ([127.0.0.1]:45094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIAdz-0004je-3O for submit@debbugs.gnu.org; Sat, 08 Jul 2023 12:18:47 -0400 Received: from robust-software.ca ([174.136.98.50]:42330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIAdw-0004jP-02 for 64311-done@debbugs.gnu.org; Sat, 08 Jul 2023 12:18:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=virgo1; bh=S/3UmTAP1kOBW Dmmo87Ud4C+RtDsD07aIEUrfYW7tKc=; h=date:in-reply-to:subject:cc:to: from:references; d=oneofus.la; b=XIBvBfk3909GM3+SZ5oA34N7HGU+xYj/YVx46 hjPbna0og5BgzI84Qm0Reo8GW/w7nYQWH4+Jj14iEfGal7fCLleLjNYFpKbbAaNY0aMswU M5BHp0mHoKZmy4FoGaZuvaX+2keEobgZ9WI4pBQZkabHAMhv8q72vOUu6QkHEhUo= Received: from t510.orion.oneofus.la (node-1w7jra28qzk6x26tggabny44d.ipv6.telus.net [2001:56a:f913:3c01:416e:73e7:ae69:6c5d]) by virgo1.oneofus.la (OpenSMTPD) with ESMTPSA id be1d70a4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 8 Jul 2023 09:18:42 -0700 (PDT) References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> <87h6qjfh2y.fsf@t510.orion.oneofus.la> <878rbspyuf.fsf@t510.orion.oneofus.la> <83r0pidcv2.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 28.2 From: Vladimir Sedach To: Eli Zaretskii Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers In-reply-to: <83r0pidcv2.fsf@gnu.org> Date: Sat, 08 Jul 2023 10:18:40 -0600 Message-ID: <871qhitlzz.fsf@t510.orion.oneofus.la> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64311-done Cc: 64311-done@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks, I installed this, with slight changes, on the master branch, > and I'm therefore closing this bug. Thank you. There is also the unit tests patch in the original email (attached here as well) that should be applied. -- Vladimir Sedach --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-test-lisp-shell-tests.el-added-tests-for-shell-dirtr.patch >From ce4b041bd71cd7ee1b025cc14ae962f8d98d9478 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Mon, 26 Jun 2023 22:30:25 -0600 Subject: [PATCH 1/2] ; * test/lisp/shell-tests.el: added tests for shell-dirtrack-mode --- test/lisp/shell-tests.el | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el index db9124e2435..ddddfdb2e0f 100644 --- a/test/lisp/shell-tests.el +++ b/test/lisp/shell-tests.el @@ -64,4 +64,35 @@ shell-tests-split-string (should (equal (split-string-shell-command "ls /tmp/foo\\ bar") '("ls" "/tmp/foo bar"))))) +(ert-deftest shell-dirtrack-on-by-default () + (with-temp-buffer + (shell-mode) + (should shell-dirtrack-mode))) + +(ert-deftest shell-dirtrack-should-not-be-on-in-unrelated-modes () + (with-temp-buffer + (should (not shell-dirtrack-mode)))) + +(ert-deftest shell-dirtrack-sets-list-buffers-directory () + (let ((start-dir default-directory)) + (with-temp-buffer + (should-not list-buffers-directory) + (shell-mode) + (shell-cd "..") + (should list-buffers-directory) + (should (not (equal start-dir list-buffers-directory))) + (should (string-prefix-p list-buffers-directory start-dir))))) + +(ert-deftest shell-directory-tracker-cd () + (let ((start-dir default-directory)) + (with-temp-buffer + (should-not list-buffers-directory) + (shell-mode) + (cl-letf (((symbol-function 'shell-unquote-argument) + (lambda (x) x))) + (shell-directory-tracker "cd ..")) + (should list-buffers-directory) + (should (not (equal start-dir list-buffers-directory))) + (should (string-prefix-p list-buffers-directory start-dir))))) + ;;; shell-tests.el ends here -- 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 12:31:22 2023 Received: (at 64311-done) by debbugs.gnu.org; 8 Jul 2023 16:31:22 +0000 Received: from localhost ([127.0.0.1]:45105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIAq9-0005CL-PC for submit@debbugs.gnu.org; Sat, 08 Jul 2023 12:31:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIAq5-0005Bz-Ie for 64311-done@debbugs.gnu.org; Sat, 08 Jul 2023 12:31:20 -0400 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 1qIAq0-0008Qs-2A; Sat, 08 Jul 2023 12:31:12 -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=6etVNTqUs1JEVJV/orE2/f4J9+Ch7vdtgERpQ2cdzps=; b=rQEbD1jXls/X GcA96YPNH0bEHA83yNw31CK2XgvYGzqB/JqHbqOOvW8nqhkkS7kb5wrATjNJgJPlLQPv48l3/gXGL LOFpL1S7E2WDq+4B8UbYQcaFSMqUmreZNPnPC7n5UvHL0KXVkXShcxcr0bED4LAv42TC57uMQktss rRQgo9a80Q6NpFVVY/UFeeTBfXlZXaYJNfCAoCkhaAKpQRwzHnLQCEEjJxuM5j4otoaLFLmX+Huxu 2s8jiqz0mOUlpoLrpJYe/0/n9PQk1FRnLTv/rVtckccimExslBuOOJCy6MEb+5Wy5zLQlJioQ7PsQ rWkVd9MCV33pOswTiw5DIw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIApy-0002ok-MA; Sat, 08 Jul 2023 12:31:11 -0400 Date: Sat, 08 Jul 2023 19:31:15 +0300 Message-Id: <834jmecqlo.fsf@gnu.org> From: Eli Zaretskii To: Vladimir Sedach In-Reply-To: <871qhitlzz.fsf@t510.orion.oneofus.la> (message from Vladimir Sedach on Sat, 08 Jul 2023 10:18:40 -0600) Subject: Re: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers References: <87pm5h4iy1.fsf@t510.orion.oneofus.la> <831qhwx5qf.fsf@gnu.org> <87zg4k76es.fsf@orphne.orion.oneofus.la> <83mt0jvmfu.fsf@gnu.org> <87r0pva66g.fsf@t510.orion.oneofus.la> <834jmrv3p6.fsf@gnu.org> <87o7kz9wej.fsf@t510.orion.oneofus.la> <83wmzmuaq7.fsf@gnu.org> <87wmzmb5fl.fsf@t510.orion.oneofus.la> <83a5wita0p.fsf@gnu.org> <87ttuqax6d.fsf@t510.orion.oneofus.la> <835y75tsn7.fsf@gnu.org> <87r0ps7v92.fsf@t510.orion.oneofus.la> <831qhqq0kf.fsf@gnu.org> <837crfll1t.fsf@gnu.org> <87h6qjfh2y.fsf@t510.orion.oneofus.la> <878rbspyuf.fsf@t510.orion.oneofus.la> <83r0pidcv2.fsf@gnu.org> <871qhitlzz.fsf@t510.orion.oneofus.la> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64311-done Cc: 64311-done@debbugs.gnu.org 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: -3.3 (---) > From: Vladimir Sedach > Cc: 64311-done@debbugs.gnu.org > Date: Sat, 08 Jul 2023 10:18:40 -0600 > > Eli Zaretskii writes: > > > Thanks, I installed this, with slight changes, on the master branch, > > and I'm therefore closing this bug. > > Thank you. There is also the unit tests patch in the original email > (attached here as well) that should be applied. Thanks, installed. From unknown Sun Jun 22 11:45:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 06 Aug 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator