bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Clément Pit-Claudel
Subject: bug#5950: defvaralias after defvar should be warned in runtime
Date: Thu, 2 Aug 2018 23:33:39 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-08-02 13:03, Stefan Monnier wrote:
>>> 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)
>>
>> Thanks.  Should the warning be disabled when both variables are
>> already `defvar'd, then?
> 
> Why?  Replace `setq` with `defvar` in the above scenario and you have
> the same problem.

Do you? I thought the problem was that you were overwriting a user setting… if 
you change the first setq into a defvar, where's the user setting that you're 
overwriting?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]