aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-15 00:42:19 +0000
committerRichard M. Stallman1994-12-15 00:42:19 +0000
commita42ba017bc22ce7714ecd981b25332f92cc02af0 (patch)
tree33b35752b2c3180233d2177ec10e63c15c45b42a /src
parentb448bfa0285ae8bdbe427b6e2d1dbaa1c8a9535d (diff)
downloademacs-a42ba017bc22ce7714ecd981b25332f92cc02af0.tar.gz
emacs-a42ba017bc22ce7714ecd981b25332f92cc02af0.zip
(Fdefconst, Fdefvar): Error if too many arguments.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/eval.c b/src/eval.c
index eafb9e84a65..f5dd69ff057 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -571,18 +571,21 @@ If INITVALUE is missing, SYMBOL's value is not set.")
571 (args) 571 (args)
572 Lisp_Object args; 572 Lisp_Object args;
573{ 573{
574 register Lisp_Object sym, tem; 574 register Lisp_Object sym, tem, tail;
575 575
576 sym = Fcar (args); 576 sym = Fcar (args);
577 tem = Fcdr (args); 577 tail = Fcdr (args);
578 if (!NILP (tem)) 578 if (!NILP (Fcdr (Fcdr (tail))))
579 error ("too many arguments");
580
581 if (!NILP (tail))
579 { 582 {
580 tem = Fdefault_boundp (sym); 583 tem = Fdefault_boundp (sym);
581 if (NILP (tem)) 584 if (NILP (tem))
582 Fset_default (sym, Feval (Fcar (Fcdr (args)))); 585 Fset_default (sym, Feval (Fcar (Fcdr (args))));
583 } 586 }
584 tem = Fcar (Fcdr (Fcdr (args))); 587 tail = Fcdr (Fcdr (args));
585 if (!NILP (tem)) 588 if (!NILP (Fcar (tail)))
586 { 589 {
587 if (!NILP (Vpurify_flag)) 590 if (!NILP (Vpurify_flag))
588 tem = Fpurecopy (tem); 591 tem = Fpurecopy (tem);
@@ -612,6 +615,9 @@ it would override the user's choice.")
612 register Lisp_Object sym, tem; 615 register Lisp_Object sym, tem;
613 616
614 sym = Fcar (args); 617 sym = Fcar (args);
618 if (!NILP (Fcdr (Fcdr (Fcdr (args)))))
619 error ("too many arguments");
620
615 Fset_default (sym, Feval (Fcar (Fcdr (args)))); 621 Fset_default (sym, Feval (Fcar (Fcdr (args))));
616 tem = Fcar (Fcdr (Fcdr (args))); 622 tem = Fcar (Fcdr (Fcdr (args)));
617 if (!NILP (tem)) 623 if (!NILP (tem))