Mercurial > emacs
changeset 37851:3083aa4f6a47
(Fintern, Funintern): Set symbol's interned and constant
bit-fields.
(init_obarray): Likewise for t and nil.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 21 May 2001 12:22:35 +0000 |
parents | c03ac59bab50 |
children | 841de8d087fa |
files | src/lread.c |
diffstat | 1 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lread.c Mon May 21 12:22:16 2001 +0000 +++ b/src/lread.c Mon May 21 12:22:35 2001 +0000 @@ -2901,11 +2901,18 @@ if (!NILP (Vpurify_flag)) string = Fpurecopy (string); sym = Fmake_symbol (string); - XSYMBOL (sym)->obarray = obarray; + + if (EQ (obarray, initial_obarray)) + XSYMBOL (sym)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; + else + XSYMBOL (sym)->interned = SYMBOL_INTERNED; if ((XSTRING (string)->data[0] == ':') && EQ (obarray, initial_obarray)) - XSYMBOL (sym)->value = sym; + { + XSYMBOL (sym)->constant = 1; + XSYMBOL (sym)->value = sym; + } ptr = &XVECTOR (obarray)->contents[XINT (tem)]; if (SYMBOLP (*ptr)) @@ -2978,7 +2985,9 @@ if (SYMBOLP (name) && !EQ (name, tem)) return Qnil; - XSYMBOL (tem)->obarray = Qnil; + XSYMBOL (tem)->interned = SYMBOL_UNINTERNED; + XSYMBOL (tem)->constant = 0; + XSYMBOL (tem)->indirect_variable = 0; hash = oblookup_last_bucket_number; @@ -3135,7 +3144,9 @@ initial_obarray = Vobarray; staticpro (&initial_obarray); /* Intern nil in the obarray */ - XSYMBOL (Qnil)->obarray = Vobarray; + XSYMBOL (Qnil)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; + XSYMBOL (Qnil)->constant = 1; + /* These locals are to kludge around a pyramid compiler bug. */ hash = hash_string ("nil", 3); /* Separate statement here to avoid VAXC bug. */ @@ -3152,6 +3163,7 @@ XSYMBOL (Qnil)->value = Qnil; XSYMBOL (Qnil)->plist = Qnil; XSYMBOL (Qt)->value = Qt; + XSYMBOL (Qt)->constant = 1; /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */ Vpurify_flag = Qt; @@ -3197,7 +3209,7 @@ val = allocate_misc (); XMISCTYPE (val) = Lisp_Misc_Intfwd; XINTFWD (val)->intvar = address; - XSYMBOL (sym)->value = val; + SET_SYMBOL_VALUE (sym, val); } /* Similar but define a variable whose value is T if address contains 1, @@ -3212,7 +3224,7 @@ val = allocate_misc (); XMISCTYPE (val) = Lisp_Misc_Boolfwd; XBOOLFWD (val)->boolvar = address; - XSYMBOL (sym)->value = val; + SET_SYMBOL_VALUE (sym, val); Vbyte_boolean_vars = Fcons (sym, Vbyte_boolean_vars); } @@ -3231,7 +3243,7 @@ val = allocate_misc (); XMISCTYPE (val) = Lisp_Misc_Objfwd; XOBJFWD (val)->objvar = address; - XSYMBOL (sym)->value = val; + SET_SYMBOL_VALUE (sym, val); } void @@ -3264,7 +3276,7 @@ XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; XBUFFER_OBJFWD (val)->offset = offset; - XSYMBOL (sym)->value = val; + SET_SYMBOL_VALUE (sym, val); PER_BUFFER_SYMBOL (offset) = sym; PER_BUFFER_TYPE (offset) = type; @@ -3288,7 +3300,7 @@ val = allocate_misc (); XMISCTYPE (val) = Lisp_Misc_Kboard_Objfwd; XKBOARD_OBJFWD (val)->offset = offset; - XSYMBOL (sym)->value = val; + SET_SYMBOL_VALUE (sym, val); } /* Record the value of load-path used at the start of dumping