Subject: Re: bug#5950: defvaralias after defvar should be warned in runtime

From: Noam Postavsky <[email-masked]>
Date: Thu, 2 Aug 2018 09:28:51 -0400

On 2 August 2018 at 09:08, Clément Pit-Claudel <[email-masked]> wrote:

>> Usually the warning is due to the defvaralias call being performed after
>> the corresponding `defvar`s.
>
> Right. But why is that a problem?

The typical failure case goes like this, user does this:

(setq the-package-setting 'foo)
(require 'the-package)

And the-package.el does this:

(defvar the-package-real-setting 'bar)
;; Oops! User's setting of `foo' is overwritten here:
(defvaralias 'the-package-setting 'the-package-real-setting)

See Bug#31603 for a real life example.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31603