comparison src/lread.c @ 1009:bf78b5ea9b3a

* lread.c (defvar_per_buffer): Support new TYPE argument, by setting the appropriate slot in buffer_local_types.
author Jim Blandy <jimb@redhat.com>
date Wed, 19 Aug 1992 06:33:16 +0000
parents 9620f7edf04d
children c2259db856ee
comparison
equal deleted inserted replaced
1008:f1df63f98e5c 1009:bf78b5ea9b3a
1470 1470
1471 /* Similar but define a variable whose value is the Lisp Object stored in 1471 /* Similar but define a variable whose value is the Lisp Object stored in
1472 the current buffer. address is the address of the slot in the buffer that is current now. */ 1472 the current buffer. address is the address of the slot in the buffer that is current now. */
1473 1473
1474 void 1474 void
1475 defvar_per_buffer (namestring, address, doc) 1475 defvar_per_buffer (namestring, address, type, doc)
1476 char *namestring; 1476 char *namestring;
1477 Lisp_Object *address; 1477 Lisp_Object *address;
1478 Lisp_Object type;
1478 char *doc; 1479 char *doc;
1479 { 1480 {
1480 Lisp_Object sym; 1481 Lisp_Object sym;
1481 int offset; 1482 int offset;
1482 extern struct buffer buffer_local_symbols; 1483 extern struct buffer buffer_local_symbols;
1485 offset = (char *)address - (char *)current_buffer; 1486 offset = (char *)address - (char *)current_buffer;
1486 1487
1487 XSET (XSYMBOL (sym)->value, Lisp_Buffer_Objfwd, 1488 XSET (XSYMBOL (sym)->value, Lisp_Buffer_Objfwd,
1488 (Lisp_Object *) offset); 1489 (Lisp_Object *) offset);
1489 *(Lisp_Object *)(offset + (char *)&buffer_local_symbols) = sym; 1490 *(Lisp_Object *)(offset + (char *)&buffer_local_symbols) = sym;
1491 *(Lisp_Object *)(offset + (char *)&buffer_local_types) = type;
1490 if (*(int *)(offset + (char *)&buffer_local_flags) == 0) 1492 if (*(int *)(offset + (char *)&buffer_local_flags) == 0)
1491 /* Did a DEFVAR_PER_BUFFER without initializing the corresponding 1493 /* Did a DEFVAR_PER_BUFFER without initializing the corresponding
1492 slot of buffer_local_flags */ 1494 slot of buffer_local_flags */
1493 abort (); 1495 abort ();
1494 } 1496 }