# HG changeset patch # User Stefan Monnier # Date 989873527 0 # Node ID f981769638816fc0b88caacbf0a0c6a6ce238a07 # Parent 7c313c4b3eba942cc02ed92f42baa0cc4e05ca5d (Fdefvar): Only record (defvar ) in the load-history in has no default value yet. diff -r 7c313c4b3eba -r f98176963881 src/eval.c --- a/src/eval.c Mon May 14 17:52:12 2001 +0000 +++ b/src/eval.c Mon May 14 20:52:07 2001 +0000 @@ -686,21 +686,28 @@ if (!NILP (Fcdr (Fcdr (tail)))) error ("too many arguments"); + tem = Fdefault_boundp (sym); if (!NILP (tail)) { - tem = Fdefault_boundp (sym); if (NILP (tem)) - Fset_default (sym, Feval (Fcar (Fcdr (args)))); + Fset_default (sym, Feval (Fcar (tail))); + tail = Fcdr (tail); + if (!NILP (Fcar (tail))) + { + tem = Fcar (tail); + if (!NILP (Vpurify_flag)) + tem = Fpurecopy (tem); + Fput (sym, Qvariable_documentation, tem); + } + LOADHIST_ATTACH (sym); } - tail = Fcdr (Fcdr (args)); - if (!NILP (Fcar (tail))) - { - tem = Fcar (tail); - if (!NILP (Vpurify_flag)) - tem = Fpurecopy (tem); - Fput (sym, Qvariable_documentation, tem); - } - LOADHIST_ATTACH (sym); + else + /* A (defvar ) should not take precedence in the load-history over + an earlier (defvar ), so only add to history if the default + value is still unbound. */ + if (NILP (tem)) + LOADHIST_ATTACH (sym); + return sym; }