unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5950: defvaralias after defvar should be warned in runtime
@ 2010-04-15  5:13 IRIE Shinsuke
  2010-09-15 20:16 ` Glenn Morris
  2018-08-02  2:14 ` Noam Postavsky
  0 siblings, 2 replies; 20+ messages in thread
From: IRIE Shinsuke @ 2010-04-15  5:13 UTC (permalink / raw)
  To: 5950

Please consider below:

We assume an user wrote .emacs file as:

 (setq old-foo 123)
 (load "bar")

Here, bar.el includes the following:

 (defvar foo 456)
 (define-obsolete-variable-alias 'old-foo 'foo)

By this .emacs setting, the user probably hopes `old-foo' remains 123
after loading bar.el, but actually it will be changed to 456. This
behavior is inconsistent with the principle that `defvar' must not
override existing value, so bar.el should be modified as:

 (define-obsolete-variable-alias 'old-foo 'foo)
 (defvar foo 456)

I think the programs like bar.el should be warned when running (and
byte-compiling, if possible).

-- 
IRIE Shinsuke, Ph.D.







^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-08-03 22:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).