comparison src/symbols.c @ 793:e38acbeb1cae

[xemacs-hg @ 2002-03-29 04:46:17 by ben] lots o' fixes etc/ChangeLog: New file. Separated out all entries for etc/ into their own ChangeLog. Includes entries for the following files: etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad, etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL, etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS, etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL, etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se, etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh, etc/custom/example-themes/europe-theme.el, etc/custom/example-themes/ex-custom-file, etc/custom/example-themes/example-theme.el, etc/e/eterm.ti, etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1, etc/gnuserv.README, etc/package-index.LATEST.gpg, etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm, etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs, etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E, etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar, etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1, etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL, etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el, etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\* unicode/unicode-consortium/8859-16.TXT: New file. mule/english.el: Define this charset now, since a bug was fixed that formerly prevented it. mule/ethio-util.el: Fix compile errors involving Unicode `characters', which should be integers. Makefile.in.in: Always include gui.c, to fix compile error when TTY-only. EmacsFrame.c, abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, bytecode.h, callint.c, callproc.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.c, console-msw.h, console-tty.c, console-x.c, console-x.h, console.c, console.h, data.c, database.c, device-gtk.c, device-msw.c, device-x.c, device.c, device.h, dialog-msw.c, doc.c, doprnt.c, dumper.c, dynarr.c, editfns.c, eldap.c, eldap.h, elhash.c, elhash.h, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, events.h, extents.c, extents.h, faces.c, faces.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, free-hook.c, general-slots.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gtk-xemacs.c, gui-msw.c, gui-x.c, gui-x.h, gui.c, gui.h, gutter.c, gutter.h, indent.c, input-method-xlib.c, insdel.c, keymap.c, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-canna.c, mule-ccl.c, mule-charset.c, mule-wnnfns.c, native-gtk-toolbar.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, opaque.c, opaque.h, postgresql.c, postgresql.h, print.c, process-unix.c, process.c, process.h, rangetab.c, rangetab.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, search.c, select-gtk.c, select-x.c, sound.c, specifier.c, specifier.h, strftime.c, symbols.c, symeval.h, syntax.h, text.c, text.h, toolbar-common.c, toolbar-msw.c, toolbar.c, toolbar.h, tooltalk.c, tooltalk.h, ui-gtk.c, ui-gtk.h, undo.c, vm-limit.c, window.c, window.h: Eliminate XSETFOO. Replace all usages with wrap_foo(). Make symbol->name a Lisp_Object, not Lisp_String *. Eliminate nearly all uses of Lisp_String * in favor of Lisp_Object, and correct macros so most of them favor Lisp_Object. Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings, but at level `debug' (usually ignored). Use it when instantiating specifiers, so problems can be debugged. Move log-warning-minimum-level into C so that we can optimize ERROR_ME_DEBUG_WARN. Fix warning levels consistent with new definitions. Add default_ and parent fields to char table; not yet implemented. New fun Dynarr_verify(); use for further error checking on Dynarrs. Rearrange code at top of lisp.h in conjunction with dynarr changes. Fix eifree(). Use Eistrings in various places (format_event_object(), where_is_to_char(), and callers thereof) to avoid fixed-size strings buffers. New fun write_eistring(). Reindent and fix GPM code to follow standards. Set default MS Windows font to Lucida Console (same size as Courier New but less interline spacing, so more lines fit). Increase default frame size on Windows to 50 lines. (If that's too big for the workspace, the frame will be shrunk as necessary.) Fix problem with text files with no newlines (). (Change `convert-eol' coding system to use `nil' for autodetect, consistent with make-coding-system.) Correct compile warnings in vm-limit.c. Fix handling of reverse-direction charsets to avoid errors when opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el. Recode some object printing methods to use write_fmt_string() instead of a fixed buffer and sprintf. Turn on display of png comments as warnings (level `info'), now that they're unobtrusive. Revamped the sound documentation. Fixed bug in redisplay w.r.t. hscroll/truncation/continuation glyphs causing jumping up and down of the lines, since they're bigger than the line size. (It was seen most obviously when there's a horizontal scroll bar, e.g. do C-h a glyph or something like that.) The problem was that the glyph-contrib-p setting on glyphs was ignored even if it was set properly, which it wasn't until now.
author ben
date Fri, 29 Mar 2002 04:49:13 +0000
parents 943eaba38521
children a5954632b187
comparison
equal deleted inserted replaced
792:4e83fdb13eb9 793:e38acbeb1cae
1 /* "intern" and friends -- moved here from lread.c and data.c 1 /* "intern" and friends -- moved here from lread.c and data.c
2 Copyright (C) 1985-1989, 1992-1994 Free Software Foundation, Inc. 2 Copyright (C) 1985-1989, 1992-1994 Free Software Foundation, Inc.
3 Copyright (C) 1995, 2000, 2001 Ben Wing. 3 Copyright (C) 1995, 2000, 2001, 2002 Ben Wing.
4 4
5 This file is part of XEmacs. 5 This file is part of XEmacs.
6 6
7 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
88 88
89 static Lisp_Object 89 static Lisp_Object
90 mark_symbol (Lisp_Object obj) 90 mark_symbol (Lisp_Object obj)
91 { 91 {
92 Lisp_Symbol *sym = XSYMBOL (obj); 92 Lisp_Symbol *sym = XSYMBOL (obj);
93 Lisp_Object pname;
94 93
95 mark_object (sym->value); 94 mark_object (sym->value);
96 mark_object (sym->function); 95 mark_object (sym->function);
97 XSETSTRING (pname, sym->name); 96 mark_object (sym->name);
98 mark_object (pname);
99 if (!symbol_next (sym)) 97 if (!symbol_next (sym))
100 return sym->plist; 98 return sym->plist;
101 else 99 else
102 { 100 {
103 mark_object (sym->plist); 101 mark_object (sym->plist);
104 /* Mark the rest of the symbols in the obarray hash-chain */ 102 /* Mark the rest of the symbols in the obarray hash-chain */
105 sym = symbol_next (sym); 103 sym = symbol_next (sym);
106 XSETSYMBOL (obj, sym); 104 return wrap_symbol (sym);
107 return obj;
108 } 105 }
109 } 106 }
110 107
111 static const struct lrecord_description symbol_description[] = { 108 static const struct lrecord_description symbol_description[] = {
112 { XD_LISP_OBJECT, offsetof (Lisp_Symbol, next) }, 109 { XD_LISP_OBJECT, offsetof (Lisp_Symbol, next) },
207 it defaults to the value of the variable `obarray'. 204 it defaults to the value of the variable `obarray'.
208 */ 205 */
209 (string, obarray)) 206 (string, obarray))
210 { 207 {
211 Lisp_Object object, *ptr; 208 Lisp_Object object, *ptr;
212 Lisp_Symbol *symbol; 209 Lisp_Object symbol;
213 Bytecount len; 210 Bytecount len;
214 211
215 if (NILP (obarray)) obarray = Vobarray; 212 if (NILP (obarray)) obarray = Vobarray;
216 obarray = check_obarray (obarray); 213 obarray = check_obarray (obarray);
217 214
224 return object; 221 return object;
225 222
226 ptr = &XVECTOR_DATA (obarray)[XINT (object)]; 223 ptr = &XVECTOR_DATA (obarray)[XINT (object)];
227 224
228 object = Fmake_symbol (string); 225 object = Fmake_symbol (string);
229 symbol = XSYMBOL (object); 226 symbol = object;
230 227
231 if (SYMBOLP (*ptr)) 228 if (SYMBOLP (*ptr))
232 symbol_next (symbol) = XSYMBOL (*ptr); 229 XSYMBOL_NEXT (symbol) = XSYMBOL (*ptr);
233 else 230 else
234 symbol_next (symbol) = 0; 231 XSYMBOL_NEXT (symbol) = 0;
235 *ptr = object; 232 *ptr = object;
236 233
237 if (string_byte (symbol_name (symbol), 0) == ':' && EQ (obarray, Vobarray)) 234 if (XSTRING_BYTE (XSYMBOL_NAME (symbol), 0) == ':' && EQ (obarray, Vobarray))
238 { 235 {
239 /* The LISP way is to put keywords in their own package, but we 236 /* The LISP way is to put keywords in their own package, but we
240 don't have packages, so we do something simpler. Someday, 237 don't have packages, so we do something simpler. Someday,
241 maybe we'll have packages and then this will be reworked. 238 maybe we'll have packages and then this will be reworked.
242 --Stig. */ 239 --Stig. */
243 symbol_value (symbol) = object; 240 XSYMBOL_VALUE (symbol) = object;
244 } 241 }
245 242
246 return object; 243 return object;
247 } 244 }
248 245
256 (name, obarray)) 253 (name, obarray))
257 { 254 {
258 /* #### Bug! (intern-soft "nil") returns nil. Perhaps we should 255 /* #### Bug! (intern-soft "nil") returns nil. Perhaps we should
259 add a DEFAULT-IF-NOT-FOUND arg, like in get. */ 256 add a DEFAULT-IF-NOT-FOUND arg, like in get. */
260 Lisp_Object tem; 257 Lisp_Object tem;
261 Lisp_String *string; 258 Lisp_Object string;
262 259
263 if (NILP (obarray)) obarray = Vobarray; 260 if (NILP (obarray)) obarray = Vobarray;
264 obarray = check_obarray (obarray); 261 obarray = check_obarray (obarray);
265 262
266 if (!SYMBOLP (name)) 263 if (!SYMBOLP (name))
267 { 264 {
268 CHECK_STRING (name); 265 CHECK_STRING (name);
269 string = XSTRING (name); 266 string = name;
270 } 267 }
271 else 268 else
272 string = symbol_name (XSYMBOL (name)); 269 string = symbol_name (XSYMBOL (name));
273 270
274 tem = oblookup (obarray, string_data (string), string_length (string)); 271 tem = oblookup (obarray, XSTRING_DATA (string), XSTRING_LENGTH (string));
275 if (INTP (tem) || (SYMBOLP (name) && !EQ (name, tem))) 272 if (INTP (tem) || (SYMBOLP (name) && !EQ (name, tem)))
276 return Qnil; 273 return Qnil;
277 else 274 else
278 return tem; 275 return tem;
279 } 276 }
286 OBARRAY defaults to the value of the variable `obarray'. 283 OBARRAY defaults to the value of the variable `obarray'.
287 */ 284 */
288 (name, obarray)) 285 (name, obarray))
289 { 286 {
290 Lisp_Object tem; 287 Lisp_Object tem;
291 Lisp_String *string; 288 Lisp_Object string;
292 int hash; 289 int hash;
293 290
294 if (NILP (obarray)) obarray = Vobarray; 291 if (NILP (obarray)) obarray = Vobarray;
295 obarray = check_obarray (obarray); 292 obarray = check_obarray (obarray);
296 293
297 if (SYMBOLP (name)) 294 if (SYMBOLP (name))
298 string = symbol_name (XSYMBOL (name)); 295 string = symbol_name (XSYMBOL (name));
299 else 296 else
300 { 297 {
301 CHECK_STRING (name); 298 CHECK_STRING (name);
302 string = XSTRING (name); 299 string = name;
303 } 300 }
304 301
305 tem = oblookup (obarray, string_data (string), string_length (string)); 302 tem = oblookup (obarray, XSTRING_DATA (string), XSTRING_LENGTH (string));
306 if (INTP (tem)) 303 if (INTP (tem))
307 return Qnil; 304 return Qnil;
308 /* If arg was a symbol, don't delete anything but that symbol itself. */ 305 /* If arg was a symbol, don't delete anything but that symbol itself. */
309 if (SYMBOLP (name) && !EQ (name, tem)) 306 if (SYMBOLP (name) && !EQ (name, tem))
310 return Qnil; 307 return Qnil;
312 hash = oblookup_last_bucket_number; 309 hash = oblookup_last_bucket_number;
313 310
314 if (EQ (XVECTOR_DATA (obarray)[hash], tem)) 311 if (EQ (XVECTOR_DATA (obarray)[hash], tem))
315 { 312 {
316 if (XSYMBOL (tem)->next) 313 if (XSYMBOL (tem)->next)
317 XSETSYMBOL (XVECTOR_DATA (obarray)[hash], XSYMBOL (tem)->next); 314 XVECTOR_DATA (obarray)[hash] = wrap_symbol (XSYMBOL (tem)->next);
318 else 315 else
319 XVECTOR_DATA (obarray)[hash] = Qzero; 316 XVECTOR_DATA (obarray)[hash] = Qzero;
320 } 317 }
321 else 318 else
322 { 319 {
324 321
325 for (tail = XVECTOR_DATA (obarray)[hash]; 322 for (tail = XVECTOR_DATA (obarray)[hash];
326 XSYMBOL (tail)->next; 323 XSYMBOL (tail)->next;
327 tail = following) 324 tail = following)
328 { 325 {
329 XSETSYMBOL (following, XSYMBOL (tail)->next); 326 following = wrap_symbol (XSYMBOL (tail)->next);
330 if (EQ (following, tem)) 327 if (EQ (following, tem))
331 { 328 {
332 XSYMBOL (tail)->next = XSYMBOL (following)->next; 329 XSYMBOL (tail)->next = XSYMBOL (following)->next;
333 break; 330 break;
334 } 331 }
364 else if (!SYMBOLP (bucket)) 361 else if (!SYMBOLP (bucket))
365 signal_error (Qinvalid_state, "Bad data in guts of obarray", Qunbound); /* Like CADR error message */ 362 signal_error (Qinvalid_state, "Bad data in guts of obarray", Qunbound); /* Like CADR error message */
366 else 363 else
367 for (tail = XSYMBOL (bucket); ;) 364 for (tail = XSYMBOL (bucket); ;)
368 { 365 {
369 if (string_length (tail->name) == size && 366 if (XSTRING_LENGTH (tail->name) == size &&
370 !memcmp (string_data (tail->name), ptr, size)) 367 !memcmp (XSTRING_DATA (tail->name), ptr, size))
371 { 368 {
372 XSETSYMBOL (bucket, tail); 369 return wrap_symbol (tail);
373 return bucket;
374 } 370 }
375 tail = symbol_next (tail); 371 tail = symbol_next (tail);
376 if (!tail) 372 if (!tail)
377 break; 373 break;
378 } 374 }
414 if ((*fn) (tail, arg)) 410 if ((*fn) (tail, arg))
415 return; 411 return;
416 next = symbol_next (XSYMBOL (tail)); 412 next = symbol_next (XSYMBOL (tail));
417 if (!next) 413 if (!next)
418 break; 414 break;
419 XSETSYMBOL (tail, next); 415 tail = wrap_symbol (next);
420 } 416 }
421 } 417 }
422 } 418 }
423 419
424 static int 420 static int
665 DEFUN ("symbol-name", Fsymbol_name, 1, 1, 0, /* 661 DEFUN ("symbol-name", Fsymbol_name, 1, 1, 0, /*
666 Return SYMBOL's name, a string. 662 Return SYMBOL's name, a string.
667 */ 663 */
668 (symbol)) 664 (symbol))
669 { 665 {
670 Lisp_Object name;
671
672 CHECK_SYMBOL (symbol); 666 CHECK_SYMBOL (symbol);
673 XSETSTRING (name, XSYMBOL (symbol)->name); 667 return XSYMBOL (symbol)->name;
674 return name;
675 } 668 }
676 669
677 DEFUN ("fset", Ffset, 2, 2, 0, /* 670 DEFUN ("fset", Ffset, 2, 2, 0, /*
678 Set SYMBOL's function definition to NEWDEF, and return NEWDEF. 671 Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
679 */ 672 */
1371 new_val = bfwd->default_value; 1364 new_val = bfwd->default_value;
1372 else 1365 else
1373 new_val = Fcdr (new_alist_el); 1366 new_val = Fcdr (new_alist_el);
1374 1367
1375 bfwd->current_alist_element = new_alist_el; 1368 bfwd->current_alist_element = new_alist_el;
1376 XSETBUFFER (bfwd->current_buffer, buf); 1369 bfwd->current_buffer = wrap_buffer (buf);
1377 1370
1378 /* Now store the value into the current-value slot. 1371 /* Now store the value into the current-value slot.
1379 We don't simply write it there, because the current-value 1372 We don't simply write it there, because the current-value
1380 slot might be a forwarding pointer, in which case we need 1373 slot might be a forwarding pointer, in which case we need
1381 to instead write the value into the C variable. 1374 to instead write the value into the C variable.
1444 flush_buffer_local_cache (sym, XSYMBOL_VALUE_BUFFER_LOCAL (value)); 1437 flush_buffer_local_cache (sym, XSYMBOL_VALUE_BUFFER_LOCAL (value));
1445 1438
1446 next = symbol_next (XSYMBOL (sym)); 1439 next = symbol_next (XSYMBOL (sym));
1447 if (!next) 1440 if (!next)
1448 break; 1441 break;
1449 XSETSYMBOL (sym, next); 1442 sym = wrap_symbol (next);
1450 } 1443 }
1451 } 1444 }
1452 } 1445 }
1453 1446
1454 1447
1865 } 1858 }
1866 } 1859 }
1867 /* Cache the new buffer's assoc in CURRENT-ALIST-ELEMENT. */ 1860 /* Cache the new buffer's assoc in CURRENT-ALIST-ELEMENT. */
1868 bfwd->current_alist_element = aelt; 1861 bfwd->current_alist_element = aelt;
1869 /* Set BUFFER, now that CURRENT-ALIST-ELEMENT is accurate. */ 1862 /* Set BUFFER, now that CURRENT-ALIST-ELEMENT is accurate. */
1870 XSETBUFFER (bfwd->current_buffer, current_buffer); 1863 bfwd->current_buffer = wrap_buffer (current_buffer);
1871 valcontents = bfwd->current_value; 1864 valcontents = bfwd->current_value;
1872 } 1865 }
1873 break; 1866 break;
1874 } 1867 }
1875 default: 1868 default:
2156 2149
2157 bfwd->default_value = find_symbol_value (variable); 2150 bfwd->default_value = find_symbol_value (variable);
2158 bfwd->current_value = valcontents; 2151 bfwd->current_value = valcontents;
2159 bfwd->current_alist_element = Qnil; 2152 bfwd->current_alist_element = Qnil;
2160 bfwd->current_buffer = Fcurrent_buffer (); 2153 bfwd->current_buffer = Fcurrent_buffer ();
2161 XSETSYMBOL_VALUE_MAGIC (foo, bfwd); 2154 foo = wrap_symbol_value_magic (bfwd);
2162 *value_slot_past_magic (variable) = foo; 2155 *value_slot_past_magic (variable) = foo;
2163 #if 1 /* #### Yuck! FSFmacs bug-compatibility*/ 2156 #if 1 /* #### Yuck! FSFmacs bug-compatibility*/
2164 /* This sets the default-value of any make-variable-buffer-local to nil. 2157 /* This sets the default-value of any make-variable-buffer-local to nil.
2165 That just sucks. User can just use setq-default to effect that, 2158 That just sucks. User can just use setq-default to effect that,
2166 but there's no way to do makunbound-default to undo this lossage. */ 2159 but there's no way to do makunbound-default to undo this lossage. */
2273 #if 0 2266 #if 0
2274 if (UNBOUNDP (bfwd->default_value)) 2267 if (UNBOUNDP (bfwd->default_value))
2275 bfwd->default_value = Qnil; /* Yuck! */ 2268 bfwd->default_value = Qnil; /* Yuck! */
2276 #endif 2269 #endif
2277 2270
2278 XSETSYMBOL_VALUE_MAGIC (valcontents, bfwd); 2271 valcontents = wrap_symbol_value_magic (bfwd);
2279 *value_slot_past_magic (variable) = valcontents; 2272 *value_slot_past_magic (variable) = valcontents;
2280 2273
2281 already_local_to_some_other_buffer: 2274 already_local_to_some_other_buffer:
2282 2275
2283 /* Make sure this buffer has its own value of variable */ 2276 /* Make sure this buffer has its own value of variable */
2284 bfwd = XSYMBOL_VALUE_BUFFER_LOCAL (valcontents); 2277 bfwd = XSYMBOL_VALUE_BUFFER_LOCAL (valcontents);
2285 2278
2286 if (UNBOUNDP (bfwd->default_value)) 2279 if (UNBOUNDP (bfwd->default_value))
2287 { 2280 {
2288 /* If default value is unbound, set local value to nil. */ 2281 /* If default value is unbound, set local value to nil. */
2289 XSETBUFFER (bfwd->current_buffer, current_buffer); 2282 bfwd->current_buffer = wrap_buffer (current_buffer);
2290 bfwd->current_alist_element = Fcons (variable, Qnil); 2283 bfwd->current_alist_element = Fcons (variable, Qnil);
2291 current_buffer->local_var_alist = 2284 current_buffer->local_var_alist =
2292 Fcons (bfwd->current_alist_element, current_buffer->local_var_alist); 2285 Fcons (bfwd->current_alist_element, current_buffer->local_var_alist);
2293 store_symval_forwarding (variable, bfwd->current_value, Qnil); 2286 store_symval_forwarding (variable, bfwd->current_value, Qnil);
2294 return variable; 2287 return variable;
2986 { 2979 {
2987 bfwd->handler[i] = Qnil; 2980 bfwd->handler[i] = Qnil;
2988 bfwd->harg[i] = Qnil; 2981 bfwd->harg[i] = Qnil;
2989 } 2982 }
2990 bfwd->shadowed = valcontents; 2983 bfwd->shadowed = valcontents;
2991 XSETSYMBOL_VALUE_MAGIC (XSYMBOL (variable)->value, bfwd); 2984 XSYMBOL (variable)->value = wrap_symbol_value_magic (bfwd);
2992 } 2985 }
2993 else 2986 else
2994 bfwd = XSYMBOL_VALUE_LISP_MAGIC (valcontents); 2987 bfwd = XSYMBOL_VALUE_LISP_MAGIC (valcontents);
2995 bfwd->handler[htype] = handler; 2988 bfwd->handler[htype] = handler;
2996 bfwd->harg[htype] = harg; 2989 bfwd->harg[htype] = harg;
3120 zero_lcrecord (&bfwd->magic); 3113 zero_lcrecord (&bfwd->magic);
3121 bfwd->magic.type = SYMVAL_VARALIAS; 3114 bfwd->magic.type = SYMVAL_VARALIAS;
3122 bfwd->aliasee = alias; 3115 bfwd->aliasee = alias;
3123 bfwd->shadowed = valcontents; 3116 bfwd->shadowed = valcontents;
3124 3117
3125 XSETSYMBOL_VALUE_MAGIC (valcontents, bfwd); 3118 valcontents = wrap_symbol_value_magic (bfwd);
3126 XSYMBOL (variable)->value = valcontents; 3119 XSYMBOL (variable)->value = valcontents;
3127 return Qnil; 3120 return Qnil;
3128 } 3121 }
3129 3122
3130 DEFUN ("variable-alias", Fvariable_alias, 1, 2, 0, /* 3123 DEFUN ("variable-alias", Fvariable_alias, 1, 2, 0, /*
3222 reinit_symbols_once_early (); 3215 reinit_symbols_once_early ();
3223 3216
3224 /* Bootstrapping problem: Qnil isn't set when make_string_nocopy is 3217 /* Bootstrapping problem: Qnil isn't set when make_string_nocopy is
3225 called the first time. */ 3218 called the first time. */
3226 Qnil = Fmake_symbol (make_string_nocopy ((const Intbyte *) "nil", 3)); 3219 Qnil = Fmake_symbol (make_string_nocopy ((const Intbyte *) "nil", 3));
3227 XSYMBOL (Qnil)->name->plist = Qnil; 3220 XSTRING_PLIST (XSYMBOL (Qnil)->name) = Qnil;
3228 XSYMBOL (Qnil)->value = Qnil; /* Nihil ex nihil */ 3221 XSYMBOL (Qnil)->value = Qnil; /* Nihil ex nihil */
3229 XSYMBOL (Qnil)->plist = Qnil; 3222 XSYMBOL (Qnil)->plist = Qnil;
3230 3223
3231 Vobarray = make_vector (OBARRAY_SIZE, Qzero); 3224 Vobarray = make_vector (OBARRAY_SIZE, Qzero);
3232 initial_obarray = Vobarray; 3225 initial_obarray = Vobarray;
3233 staticpro (&initial_obarray); 3226 staticpro (&initial_obarray);
3234 /* Intern nil in the obarray */ 3227 /* Intern nil in the obarray */
3235 { 3228 {
3236 unsigned int hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3); 3229 unsigned int hash = hash_string (XSTRING_DATA (XSYMBOL (Qnil)->name), 3);
3237 XVECTOR_DATA (Vobarray)[hash % OBARRAY_SIZE] = Qnil; 3230 XVECTOR_DATA (Vobarray)[hash % OBARRAY_SIZE] = Qnil;
3238 } 3231 }
3239 3232
3240 { 3233 {
3241 /* Required to get around a GCC syntax error on certain 3234 /* Required to get around a GCC syntax error on certain
3242 architectures */ 3235 architectures */
3243 const struct symbol_value_magic *tem = &guts_of_unbound_marker; 3236 const struct symbol_value_magic *tem = &guts_of_unbound_marker;
3244 3237
3245 XSETSYMBOL_VALUE_MAGIC (Qunbound, tem); 3238 Qunbound = wrap_symbol_value_magic (tem);
3246 } 3239 }
3247 3240
3248 XSYMBOL (Qnil)->function = Qunbound; 3241 XSYMBOL (Qnil)->function = Qunbound;
3249 3242
3250 DEFSYMBOL (Qt); 3243 DEFSYMBOL (Qt);
3420 Lisp_Object fun; 3413 Lisp_Object fun;
3421 3414
3422 check_sane_subr (subr, sym); 3415 check_sane_subr (subr, sym);
3423 check_module_subr (); 3416 check_module_subr ();
3424 3417
3425 XSETSUBR (fun, subr); 3418 fun = wrap_subr (subr);
3426 XSYMBOL (sym)->function = fun; 3419 XSYMBOL (sym)->function = fun;
3427 } 3420 }
3428 3421
3429 /* Define a lisp macro using a Lisp_Subr. */ 3422 /* Define a lisp macro using a Lisp_Subr. */
3430 void 3423 void
3434 Lisp_Object fun; 3427 Lisp_Object fun;
3435 3428
3436 check_sane_subr (subr, sym); 3429 check_sane_subr (subr, sym);
3437 check_module_subr(); 3430 check_module_subr();
3438 3431
3439 XSETSUBR (fun, subr); 3432 fun = wrap_subr (subr);
3440 XSYMBOL (sym)->function = Fcons (Qmacro, fun); 3433 XSYMBOL (sym)->function = Fcons (Qmacro, fun);
3441 } 3434 }
3442 3435
3443 static void 3436 static void
3444 deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj, 3437 deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj,
3589 else 3582 else
3590 #endif 3583 #endif
3591 sym = Fintern (make_string_nocopy ((const Intbyte *) symbol_name, 3584 sym = Fintern (make_string_nocopy ((const Intbyte *) symbol_name,
3592 strlen (symbol_name)), Qnil); 3585 strlen (symbol_name)), Qnil);
3593 3586
3594 XSETOBJ (XSYMBOL (sym)->value, magic); 3587 XSYMBOL (sym)->value = wrap_pointer_1 (magic);
3595 } 3588 }
3596 3589
3597 void 3590 void
3598 vars_of_symbols (void) 3591 vars_of_symbols (void)
3599 { 3592 {