aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorStefan Monnier2001-05-14 20:53:03 +0000
committerStefan Monnier2001-05-14 20:53:03 +0000
commit33568849577b4c07e8f8b29e187eb6ea69f0cc86 (patch)
tree9cd6215cb919e4b8cd3b0ae9a5e351043d2dd0b6 /src/eval.c
parent940cf42ecb1803d6045b80663bad85d4c24bd298 (diff)
downloademacs-33568849577b4c07e8f8b29e187eb6ea69f0cc86.tar.gz
emacs-33568849577b4c07e8f8b29e187eb6ea69f0cc86.zip
(Fdefvar): Only record (defvar <var>) in the load-history
in <var> has no default value yet.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/eval.c b/src/eval.c
index f7dd17eb5ea..42dcc814bb6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -686,21 +686,28 @@ If INITVALUE is missing, SYMBOL's value is not set.")
686 if (!NILP (Fcdr (Fcdr (tail)))) 686 if (!NILP (Fcdr (Fcdr (tail))))
687 error ("too many arguments"); 687 error ("too many arguments");
688 688
689 tem = Fdefault_boundp (sym);
689 if (!NILP (tail)) 690 if (!NILP (tail))
690 { 691 {
691 tem = Fdefault_boundp (sym);
692 if (NILP (tem)) 692 if (NILP (tem))
693 Fset_default (sym, Feval (Fcar (Fcdr (args)))); 693 Fset_default (sym, Feval (Fcar (tail)));
694 } 694 tail = Fcdr (tail);
695 tail = Fcdr (Fcdr (args)); 695 if (!NILP (Fcar (tail)))
696 if (!NILP (Fcar (tail))) 696 {
697 { 697 tem = Fcar (tail);
698 tem = Fcar (tail); 698 if (!NILP (Vpurify_flag))
699 if (!NILP (Vpurify_flag)) 699 tem = Fpurecopy (tem);
700 tem = Fpurecopy (tem); 700 Fput (sym, Qvariable_documentation, tem);
701 Fput (sym, Qvariable_documentation, tem); 701 }
702 LOADHIST_ATTACH (sym);
702 } 703 }
703 LOADHIST_ATTACH (sym); 704 else
705 /* A (defvar <var>) should not take precedence in the load-history over
706 an earlier (defvar <var> <val>), so only add to history if the default
707 value is still unbound. */
708 if (NILP (tem))
709 LOADHIST_ATTACH (sym);
710
704 return sym; 711 return sym;
705} 712}
706 713