diff options
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index adff3e8670c..e8a8e4668e4 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -786,6 +786,21 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 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)) |