unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 64311@debbugs.gnu.org, vas@oneofus.la
Subject: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers
Date: Tue, 04 Jul 2023 19:05:02 +0300	[thread overview]
Message-ID: <837crfll1t.fsf@gnu.org> (raw)
In-Reply-To: <jwvilaz4uwn.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 04 Jul 2023 10:28:55 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Vladimir Sedach <vas@oneofus.la>,  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.





  reply	other threads:[~2023-07-04 16:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  4:39 bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers Vladimir Sedach
2023-06-27 11:18 ` Eli Zaretskii
2023-06-27 14:09   ` Vladimir Sedach
2023-06-27 15:52     ` Eli Zaretskii
2023-06-28  0:07       ` Vladimir Sedach
2023-06-28 11:46         ` Eli Zaretskii
2023-06-28 16:43           ` Vladimir Sedach
2023-06-28 18:31             ` Eli Zaretskii
2023-06-28 20:14               ` Vladimir Sedach
2023-06-29  4:57                 ` Eli Zaretskii
2023-06-29 16:26                   ` Vladimir Sedach
2023-06-29 18:10                     ` Eli Zaretskii
2023-06-29 19:24                       ` Vladimir Sedach
2023-06-30  5:40                         ` Eli Zaretskii
2023-06-30 16:47                           ` Vladimir Sedach
2023-07-02  6:39                             ` Eli Zaretskii
2023-07-03 17:03                               ` Vladimir Sedach
2023-07-03 17:17                                 ` Eli Zaretskii
2023-07-04 14:28                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-04 16:05                                 ` Eli Zaretskii [this message]
2023-07-04 18:34                                   ` Vladimir Sedach
2023-07-04 20:36                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-04 22:27                                     ` Vladimir Sedach
2023-07-04 23:42                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-06 20:30                                         ` Vladimir Sedach
2023-07-08  8:30                                           ` Eli Zaretskii
2023-07-08 16:18                                             ` Vladimir Sedach
2023-07-08 16:31                                               ` Eli Zaretskii
2023-07-04  3:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-04 11:21   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837crfll1t.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64311@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=vas@oneofus.la \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).