Subject: bug#64311: [PATCH] Fix shell-dirtrack-mode showing up as enabled in unrelated buffers

From: Vladimir Sedach <[email-masked]>
Date: Mon, 03 Jul 2023 11:03:37 -0600

Eli Zaretskii <[email-masked]> 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