Mercurial > emacs
comparison src/eval.c @ 58413:73c39b73a189
(Fdefvar): Warn when var is let-bound but globally void.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 22 Nov 2004 05:26:50 +0000 |
parents | 975ba3cd4a50 |
children | 4f9314a314aa |
comparison
equal
deleted
inserted
replaced
58412:b9a1c1b8d195 | 58413:73c39b73a189 |
---|---|
784 tem = Fdefault_boundp (sym); | 784 tem = Fdefault_boundp (sym); |
785 if (!NILP (tail)) | 785 if (!NILP (tail)) |
786 { | 786 { |
787 if (NILP (tem)) | 787 if (NILP (tem)) |
788 Fset_default (sym, Feval (Fcar (tail))); | 788 Fset_default (sym, Feval (Fcar (tail))); |
789 else | |
790 { /* Check if there is really a global binding rather than just a let | |
791 binding that shadows the global unboundness of the var. */ | |
792 struct specbinding *pdl = specpdl_ptr; | |
793 while (--pdl >= specpdl) | |
794 { | |
795 if (EQ (pdl->symbol, sym) && !pdl->func | |
796 && EQ (pdl->old_value, Qunbound)) | |
797 { | |
798 message_with_string ("Warning: defvar ignored because %s is let-bound", | |
799 SYMBOL_NAME (sym), 1); | |
800 break; | |
801 } | |
802 } | |
803 } | |
789 tail = Fcdr (tail); | 804 tail = Fcdr (tail); |
790 tem = Fcar (tail); | 805 tem = Fcar (tail); |
791 if (!NILP (tem)) | 806 if (!NILP (tem)) |
792 { | 807 { |
793 if (!NILP (Vpurify_flag)) | 808 if (!NILP (Vpurify_flag)) |