all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: IRIE Shinsuke <irieshinsuke@yahoo.co.jp>,
	5950@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#5950: defvaralias after defvar should be warned in runtime
Date: Fri, 3 Aug 2018 17:00:33 -0400	[thread overview]
Message-ID: <294c0e22-7741-d1ff-bdbf-f1f96cf112a7@gmail.com> (raw)
In-Reply-To: <CAM-tV--OC1tf1Fk-ov2u8FhQW1S7gjsPy53RGsg7fbEPkZbr_g@mail.gmail.com>

On 2018-08-03 16:23, Noam Postavsky wrote:
> On 2 August 2018 at 23:33, Clément Pit-Claudel <cpitclaudel@gmail.com> wrote:
>> 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?
> 
> If the user writes defvar instead of setq, it has the exact same
> effect: they've set the-package-setting to foo, which will be
> overwritten to bar, same as before.

Right, I understand that.  But why would a user write 'defvar' to set a user variable?
I guess I'm just a bit confused by the warning.  What's the proper way to resolve it?  Should I create the alias before loading flycheck?






  reply	other threads:[~2018-08-03 21:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15  5:13 bug#5950: defvaralias after defvar should be warned in runtime IRIE Shinsuke
2010-09-15 20:16 ` Glenn Morris
2010-09-16  0:44   ` IRIE Shinsuke
2010-09-16  3:51     ` Glenn Morris
2010-09-16  9:27       ` Stefan Monnier
2018-05-26 16:52         ` Noam Postavsky
2018-05-26 19:46           ` Stefan Monnier
2018-05-26 23:54           ` Noam Postavsky
2018-06-12 11:48             ` Noam Postavsky
     [not found]               ` <cb864996-c592-5507-f0c6-be07d17f13ee@gmail.com>
     [not found]                 ` <jwvlg9pkbip.fsf-monnier+emacs@gnu.org>
2018-08-02 13:08                   ` Clément Pit-Claudel
2018-08-02 13:28                     ` Noam Postavsky
2018-08-02 14:37                       ` Clément Pit-Claudel
2018-08-02 17:03                         ` Stefan Monnier
2018-08-03  3:33                           ` Clément Pit-Claudel
2018-08-03 20:23                             ` Noam Postavsky
2018-08-03 21:00                               ` Clément Pit-Claudel [this message]
2018-08-03 22:09                                 ` Noam Postavsky
2018-08-03 22:24                                   ` Clément Pit-Claudel
2018-08-03 21:58                             ` Stefan Monnier
2018-08-02  2:14 ` Noam Postavsky

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

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

  git send-email \
    --in-reply-to=294c0e22-7741-d1ff-bdbf-f1f96cf112a7@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=5950@debbugs.gnu.org \
    --cc=irieshinsuke@yahoo.co.jp \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.