Mercurial > emacs
changeset 39580:ee9c4218a600
(Fintern, Funintern): Set symbol's interned and constant
bit-fields.
(init_obarray): Likewise for t and nil.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 05 Oct 2001 09:49:16 +0000 |
parents | e307d3530117 |
children | 6d9fa06012a6 |
files | src/lread.c |
diffstat | 1 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lread.c Fri Oct 05 09:48:47 2001 +0000 +++ b/src/lread.c Fri Oct 05 09:49:16 2001 +0000 @@ -2900,11 +2900,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)) @@ -2977,7 +2984,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; @@ -3134,7 +3143,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. */ @@ -3151,6 +3162,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; @@ -3196,7 +3208,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, @@ -3211,7 +3223,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); } @@ -3230,7 +3242,7 @@ val = allocate_misc (); XMISCTYPE (val) = Lisp_Misc_Objfwd; XOBJFWD (val)->objvar = address; - XSYMBOL (sym)->value = val; + SET_SYMBOL_VALUE (sym, val); } void @@ -3263,7 +3275,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; @@ -3287,7 +3299,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