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

From: Noam Postavsky <[email-masked]>
Date: Fri, 03 Aug 2018 18:09:12 -0400

Clément Pit-Claudel <[email-masked]> writes:

> But why would a user write 'defvar' to set a user variable?

I don't know, why would a user write 'defvaralias' to set a user
variable?  They're users, completely unpredictable!  ;)

> What's the proper way to resolve it?  Should I create the alias before
> loading flycheck?

That would work too.  I made a couple of other suggestions in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5950#42

Maybe we should add something like

    (defun defvaralias! (new-alias base-variable &optional docstring)
      (set new-alias (symbol-value base-variable))
      (defvaralias new-alias base-variable docstring))

Which you could use to tell Emacs not to care about losing the original
value of NEW-ALIAS.