comparison src/eval.c @ 59109:0b61bbccc6e1

(Fdefun, Fdefmacro): Use (defun . FN_NAME) in LOADHIST_ATTACH. (Fdefvaralias, Fdefvar, Fdefconst): Use just SYM in LOADHIST_ATTACH. (Qdefvar): Var deleted. (syms_of_eval): Don't initialze it.
author Richard M. Stallman <rms@gnu.org>
date Mon, 27 Dec 2004 16:02:24 +0000
parents a5dd77dcb82e
children d9e761d51f98 95879cc1ed20
comparison
equal deleted inserted replaced
59108:f83ca2ccbeeb 59109:0b61bbccc6e1
86 #ifdef DEBUG_GCPRO 86 #ifdef DEBUG_GCPRO
87 /* Count levels of GCPRO to detect failure to UNGCPRO. */ 87 /* Count levels of GCPRO to detect failure to UNGCPRO. */
88 int gcpro_level; 88 int gcpro_level;
89 #endif 89 #endif
90 90
91 Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun, Qdefvar; 91 Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
92 Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag; 92 Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag;
93 Lisp_Object Qand_rest, Qand_optional; 93 Lisp_Object Qand_rest, Qand_optional;
94 Lisp_Object Qdebug_on_error; 94 Lisp_Object Qdebug_on_error;
95 Lisp_Object Qdeclare; 95 Lisp_Object Qdeclare;
96 96
645 defn = Fpurecopy (defn); 645 defn = Fpurecopy (defn);
646 if (CONSP (XSYMBOL (fn_name)->function) 646 if (CONSP (XSYMBOL (fn_name)->function)
647 && EQ (XCAR (XSYMBOL (fn_name)->function), Qautoload)) 647 && EQ (XCAR (XSYMBOL (fn_name)->function), Qautoload))
648 LOADHIST_ATTACH (Fcons (Qt, fn_name)); 648 LOADHIST_ATTACH (Fcons (Qt, fn_name));
649 Ffset (fn_name, defn); 649 Ffset (fn_name, defn);
650 LOADHIST_ATTACH (fn_name); 650 LOADHIST_ATTACH (Fcons (Qdefun, fn_name));
651 return fn_name; 651 return fn_name;
652 } 652 }
653 653
654 DEFUN ("defmacro", Fdefmacro, Sdefmacro, 2, UNEVALLED, 0, 654 DEFUN ("defmacro", Fdefmacro, Sdefmacro, 2, UNEVALLED, 0,
655 doc: /* Define NAME as a macro. 655 doc: /* Define NAME as a macro.
714 defn = Fpurecopy (defn); 714 defn = Fpurecopy (defn);
715 if (CONSP (XSYMBOL (fn_name)->function) 715 if (CONSP (XSYMBOL (fn_name)->function)
716 && EQ (XCAR (XSYMBOL (fn_name)->function), Qautoload)) 716 && EQ (XCAR (XSYMBOL (fn_name)->function), Qautoload))
717 LOADHIST_ATTACH (Fcons (Qt, fn_name)); 717 LOADHIST_ATTACH (Fcons (Qt, fn_name));
718 Ffset (fn_name, defn); 718 Ffset (fn_name, defn);
719 LOADHIST_ATTACH (fn_name); 719 LOADHIST_ATTACH (Fcons (Qdefun, fn_name));
720 return fn_name; 720 return fn_name;
721 } 721 }
722 722
723 723
724 DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, 724 DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0,
740 740
741 sym = XSYMBOL (symbol); 741 sym = XSYMBOL (symbol);
742 sym->indirect_variable = 1; 742 sym->indirect_variable = 1;
743 sym->value = aliased; 743 sym->value = aliased;
744 sym->constant = SYMBOL_CONSTANT_P (aliased); 744 sym->constant = SYMBOL_CONSTANT_P (aliased);
745 LOADHIST_ATTACH (Fcons (Qdefvar, symbol)); 745 LOADHIST_ATTACH (symbol);
746 if (!NILP (docstring)) 746 if (!NILP (docstring))
747 Fput (symbol, Qvariable_documentation, docstring); 747 Fput (symbol, Qvariable_documentation, docstring);
748 748
749 return aliased; 749 return aliased;
750 } 750 }
808 { 808 {
809 if (!NILP (Vpurify_flag)) 809 if (!NILP (Vpurify_flag))
810 tem = Fpurecopy (tem); 810 tem = Fpurecopy (tem);
811 Fput (sym, Qvariable_documentation, tem); 811 Fput (sym, Qvariable_documentation, tem);
812 } 812 }
813 LOADHIST_ATTACH (Fcons (Qdefvar, sym)); 813 LOADHIST_ATTACH (sym);
814 } 814 }
815 else 815 else
816 /* Simple (defvar <var>) should not count as a definition at all. 816 /* Simple (defvar <var>) should not count as a definition at all.
817 It could get in the way of other definitions, and unloading this 817 It could get in the way of other definitions, and unloading this
818 package could try to make the variable unbound. */ 818 package could try to make the variable unbound. */
851 { 851 {
852 if (!NILP (Vpurify_flag)) 852 if (!NILP (Vpurify_flag))
853 tem = Fpurecopy (tem); 853 tem = Fpurecopy (tem);
854 Fput (sym, Qvariable_documentation, tem); 854 Fput (sym, Qvariable_documentation, tem);
855 } 855 }
856 LOADHIST_ATTACH (Fcons (Qdefvar, sym)); 856 LOADHIST_ATTACH (sym);
857 return sym; 857 return sym;
858 } 858 }
859 859
860 DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, 860 DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0,
861 doc: /* Returns t if VARIABLE is intended to be set and modified by users. 861 doc: /* Returns t if VARIABLE is intended to be set and modified by users.
3373 Qcommandp = intern ("commandp"); 3373 Qcommandp = intern ("commandp");
3374 staticpro (&Qcommandp); 3374 staticpro (&Qcommandp);
3375 3375
3376 Qdefun = intern ("defun"); 3376 Qdefun = intern ("defun");
3377 staticpro (&Qdefun); 3377 staticpro (&Qdefun);
3378
3379 Qdefvar = intern ("defvar");
3380 staticpro (&Qdefvar);
3381 3378
3382 Qand_rest = intern ("&rest"); 3379 Qand_rest = intern ("&rest");
3383 staticpro (&Qand_rest); 3380 staticpro (&Qand_rest);
3384 3381
3385 Qand_optional = intern ("&optional"); 3382 Qand_optional = intern ("&optional");