diff options
| author | Gerd Moellmann | 2001-10-05 09:49:16 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-10-05 09:49:16 +0000 |
| commit | 44c6c0191f10c4841b6230c77ba7ae007b4cd85e (patch) | |
| tree | 002a038362763dc78a4a496f18b18da0bb72094a /src/lread.c | |
| parent | a32fa736966d35fbcfbc149f5923052b183aeec0 (diff) | |
| download | emacs-44c6c0191f10c4841b6230c77ba7ae007b4cd85e.tar.gz emacs-44c6c0191f10c4841b6230c77ba7ae007b4cd85e.zip | |
(Fintern, Funintern): Set symbol's interned and constant
bit-fields.
(init_obarray): Likewise for t and nil.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/lread.c b/src/lread.c index 735d9000fae..e0720ec5dea 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2900,11 +2900,18 @@ it defaults to the value of `obarray'.") | |||
| 2900 | if (!NILP (Vpurify_flag)) | 2900 | if (!NILP (Vpurify_flag)) |
| 2901 | string = Fpurecopy (string); | 2901 | string = Fpurecopy (string); |
| 2902 | sym = Fmake_symbol (string); | 2902 | sym = Fmake_symbol (string); |
| 2903 | XSYMBOL (sym)->obarray = obarray; | 2903 | |
| 2904 | if (EQ (obarray, initial_obarray)) | ||
| 2905 | XSYMBOL (sym)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; | ||
| 2906 | else | ||
| 2907 | XSYMBOL (sym)->interned = SYMBOL_INTERNED; | ||
| 2904 | 2908 | ||
| 2905 | if ((XSTRING (string)->data[0] == ':') | 2909 | if ((XSTRING (string)->data[0] == ':') |
| 2906 | && EQ (obarray, initial_obarray)) | 2910 | && EQ (obarray, initial_obarray)) |
| 2907 | XSYMBOL (sym)->value = sym; | 2911 | { |
| 2912 | XSYMBOL (sym)->constant = 1; | ||
| 2913 | XSYMBOL (sym)->value = sym; | ||
| 2914 | } | ||
| 2908 | 2915 | ||
| 2909 | ptr = &XVECTOR (obarray)->contents[XINT (tem)]; | 2916 | ptr = &XVECTOR (obarray)->contents[XINT (tem)]; |
| 2910 | if (SYMBOLP (*ptr)) | 2917 | if (SYMBOLP (*ptr)) |
| @@ -2977,7 +2984,9 @@ OBARRAY defaults to the value of the variable `obarray'.") | |||
| 2977 | if (SYMBOLP (name) && !EQ (name, tem)) | 2984 | if (SYMBOLP (name) && !EQ (name, tem)) |
| 2978 | return Qnil; | 2985 | return Qnil; |
| 2979 | 2986 | ||
| 2980 | XSYMBOL (tem)->obarray = Qnil; | 2987 | XSYMBOL (tem)->interned = SYMBOL_UNINTERNED; |
| 2988 | XSYMBOL (tem)->constant = 0; | ||
| 2989 | XSYMBOL (tem)->indirect_variable = 0; | ||
| 2981 | 2990 | ||
| 2982 | hash = oblookup_last_bucket_number; | 2991 | hash = oblookup_last_bucket_number; |
| 2983 | 2992 | ||
| @@ -3134,7 +3143,9 @@ init_obarray () | |||
| 3134 | initial_obarray = Vobarray; | 3143 | initial_obarray = Vobarray; |
| 3135 | staticpro (&initial_obarray); | 3144 | staticpro (&initial_obarray); |
| 3136 | /* Intern nil in the obarray */ | 3145 | /* Intern nil in the obarray */ |
| 3137 | XSYMBOL (Qnil)->obarray = Vobarray; | 3146 | XSYMBOL (Qnil)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; |
| 3147 | XSYMBOL (Qnil)->constant = 1; | ||
| 3148 | |||
| 3138 | /* These locals are to kludge around a pyramid compiler bug. */ | 3149 | /* These locals are to kludge around a pyramid compiler bug. */ |
| 3139 | hash = hash_string ("nil", 3); | 3150 | hash = hash_string ("nil", 3); |
| 3140 | /* Separate statement here to avoid VAXC bug. */ | 3151 | /* Separate statement here to avoid VAXC bug. */ |
| @@ -3151,6 +3162,7 @@ init_obarray () | |||
| 3151 | XSYMBOL (Qnil)->value = Qnil; | 3162 | XSYMBOL (Qnil)->value = Qnil; |
| 3152 | XSYMBOL (Qnil)->plist = Qnil; | 3163 | XSYMBOL (Qnil)->plist = Qnil; |
| 3153 | XSYMBOL (Qt)->value = Qt; | 3164 | XSYMBOL (Qt)->value = Qt; |
| 3165 | XSYMBOL (Qt)->constant = 1; | ||
| 3154 | 3166 | ||
| 3155 | /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */ | 3167 | /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */ |
| 3156 | Vpurify_flag = Qt; | 3168 | Vpurify_flag = Qt; |
| @@ -3196,7 +3208,7 @@ defvar_int (namestring, address) | |||
| 3196 | val = allocate_misc (); | 3208 | val = allocate_misc (); |
| 3197 | XMISCTYPE (val) = Lisp_Misc_Intfwd; | 3209 | XMISCTYPE (val) = Lisp_Misc_Intfwd; |
| 3198 | XINTFWD (val)->intvar = address; | 3210 | XINTFWD (val)->intvar = address; |
| 3199 | XSYMBOL (sym)->value = val; | 3211 | SET_SYMBOL_VALUE (sym, val); |
| 3200 | } | 3212 | } |
| 3201 | 3213 | ||
| 3202 | /* Similar but define a variable whose value is T if address contains 1, | 3214 | /* Similar but define a variable whose value is T if address contains 1, |
| @@ -3211,7 +3223,7 @@ defvar_bool (namestring, address) | |||
| 3211 | val = allocate_misc (); | 3223 | val = allocate_misc (); |
| 3212 | XMISCTYPE (val) = Lisp_Misc_Boolfwd; | 3224 | XMISCTYPE (val) = Lisp_Misc_Boolfwd; |
| 3213 | XBOOLFWD (val)->boolvar = address; | 3225 | XBOOLFWD (val)->boolvar = address; |
| 3214 | XSYMBOL (sym)->value = val; | 3226 | SET_SYMBOL_VALUE (sym, val); |
| 3215 | Vbyte_boolean_vars = Fcons (sym, Vbyte_boolean_vars); | 3227 | Vbyte_boolean_vars = Fcons (sym, Vbyte_boolean_vars); |
| 3216 | } | 3228 | } |
| 3217 | 3229 | ||
| @@ -3230,7 +3242,7 @@ defvar_lisp_nopro (namestring, address) | |||
| 3230 | val = allocate_misc (); | 3242 | val = allocate_misc (); |
| 3231 | XMISCTYPE (val) = Lisp_Misc_Objfwd; | 3243 | XMISCTYPE (val) = Lisp_Misc_Objfwd; |
| 3232 | XOBJFWD (val)->objvar = address; | 3244 | XOBJFWD (val)->objvar = address; |
| 3233 | XSYMBOL (sym)->value = val; | 3245 | SET_SYMBOL_VALUE (sym, val); |
| 3234 | } | 3246 | } |
| 3235 | 3247 | ||
| 3236 | void | 3248 | void |
| @@ -3263,7 +3275,7 @@ defvar_per_buffer (namestring, address, type, doc) | |||
| 3263 | 3275 | ||
| 3264 | XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; | 3276 | XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; |
| 3265 | XBUFFER_OBJFWD (val)->offset = offset; | 3277 | XBUFFER_OBJFWD (val)->offset = offset; |
| 3266 | XSYMBOL (sym)->value = val; | 3278 | SET_SYMBOL_VALUE (sym, val); |
| 3267 | PER_BUFFER_SYMBOL (offset) = sym; | 3279 | PER_BUFFER_SYMBOL (offset) = sym; |
| 3268 | PER_BUFFER_TYPE (offset) = type; | 3280 | PER_BUFFER_TYPE (offset) = type; |
| 3269 | 3281 | ||
| @@ -3287,7 +3299,7 @@ defvar_kboard (namestring, offset) | |||
| 3287 | val = allocate_misc (); | 3299 | val = allocate_misc (); |
| 3288 | XMISCTYPE (val) = Lisp_Misc_Kboard_Objfwd; | 3300 | XMISCTYPE (val) = Lisp_Misc_Kboard_Objfwd; |
| 3289 | XKBOARD_OBJFWD (val)->offset = offset; | 3301 | XKBOARD_OBJFWD (val)->offset = offset; |
| 3290 | XSYMBOL (sym)->value = val; | 3302 | SET_SYMBOL_VALUE (sym, val); |
| 3291 | } | 3303 | } |
| 3292 | 3304 | ||
| 3293 | /* Record the value of load-path used at the start of dumping | 3305 | /* Record the value of load-path used at the start of dumping |