diff options
| author | Karl Heuer | 1994-11-11 07:32:54 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-11-11 07:32:54 +0000 |
| commit | 7d65f1c2f8c653fa9d11582f6620b4abf47903de (patch) | |
| tree | 12ec73e94f1c289cb1aa22ce63d520a94153eaa2 /src | |
| parent | d9e60f52e89cd0ea17c509ea262748e43beb816b (diff) | |
| download | emacs-7d65f1c2f8c653fa9d11582f6620b4abf47903de.tar.gz emacs-7d65f1c2f8c653fa9d11582f6620b4abf47903de.zip | |
(enum Lisp_Misc_Type): Add new enumerations Lisp_Misc_Buffer_Local_Value and
Lisp_Misc_Some_Buffer_Local_Value.
(enum Lisp_Type): Delete the corresponding enumerations from here.
(struct Lisp_Buffer_Local_Value): New structure.
(XBUFFER_LOCAL_VALUE): Access the new structure.
(BUFFER_LOCAL_VALUEP, BUFFER_SOME_LOCAL_VALUEP): Likewise.
(union Lisp_Misc): Add new member.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 93 |
1 files changed, 51 insertions, 42 deletions
diff --git a/src/lisp.h b/src/lisp.h index 23410ba2933..313b41ab4bd 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -78,45 +78,6 @@ enum Lisp_Type | |||
| 78 | Lisp_Frame, | 78 | Lisp_Frame, |
| 79 | #endif | 79 | #endif |
| 80 | 80 | ||
| 81 | /* Used in a symbol value cell when the symbol's value is per-buffer. | ||
| 82 | The actual contents are a cons cell which starts a list like this: | ||
| 83 | (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). | ||
| 84 | |||
| 85 | BUFFER is the last buffer for which this symbol's value was | ||
| 86 | made up to date. | ||
| 87 | |||
| 88 | CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's | ||
| 89 | local_var_alist, that being the element whose car is this | ||
| 90 | variable. Or it can be a pointer to the | ||
| 91 | (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), | ||
| 92 | if BUFFER does not have an element in its alist for this | ||
| 93 | variable (that is, if BUFFER sees the default value of this | ||
| 94 | variable). | ||
| 95 | |||
| 96 | If we want to examine or set the value and BUFFER is current, | ||
| 97 | we just examine or set REALVALUE. If BUFFER is not current, we | ||
| 98 | store the current REALVALUE value into CURRENT-ALIST-ELEMENT, | ||
| 99 | then find the appropriate alist element for the buffer now | ||
| 100 | current and set up CURRENT-ALIST-ELEMENT. Then we set | ||
| 101 | REALVALUE out of that element, and store into BUFFER. | ||
| 102 | |||
| 103 | If we are setting the variable and the current buffer does not | ||
| 104 | have an alist entry for this variable, an alist entry is | ||
| 105 | created. | ||
| 106 | |||
| 107 | Note that REALVALUE can be a forwarding pointer. Each time it | ||
| 108 | is examined or set, forwarding must be done. Each time we | ||
| 109 | switch buffers, buffer-local variables which forward into C | ||
| 110 | variables are swapped immediately, so the C code can assume | ||
| 111 | that they are always up to date. */ | ||
| 112 | Lisp_Buffer_Local_Value, | ||
| 113 | |||
| 114 | /* Like Lisp_Buffer_Local_Value with one difference: | ||
| 115 | merely setting the variable while some buffer is current | ||
| 116 | does not cause that buffer to have its own local value of this variable. | ||
| 117 | Only make-local-variable does that. */ | ||
| 118 | Lisp_Some_Buffer_Local_Value, | ||
| 119 | |||
| 120 | /* Window used for Emacs display. | 81 | /* Window used for Emacs display. |
| 121 | Data inside looks like a Lisp_Vector. */ | 82 | Data inside looks like a Lisp_Vector. */ |
| 122 | Lisp_Window, | 83 | Lisp_Window, |
| @@ -146,7 +107,9 @@ enum Lisp_Misc_Type | |||
| 146 | Lisp_Misc_Intfwd, | 107 | Lisp_Misc_Intfwd, |
| 147 | Lisp_Misc_Boolfwd, | 108 | Lisp_Misc_Boolfwd, |
| 148 | Lisp_Misc_Objfwd, | 109 | Lisp_Misc_Objfwd, |
| 149 | Lisp_Misc_Buffer_Objfwd | 110 | Lisp_Misc_Buffer_Objfwd, |
| 111 | Lisp_Misc_Buffer_Local_Value, | ||
| 112 | Lisp_Misc_Some_Buffer_Local_Value | ||
| 150 | }; | 113 | }; |
| 151 | 114 | ||
| 152 | #ifndef NO_UNION_TYPE | 115 | #ifndef NO_UNION_TYPE |
| @@ -419,6 +382,7 @@ extern int pure_size; | |||
| 419 | #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) | 382 | #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) |
| 420 | #define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) | 383 | #define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) |
| 421 | #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) | 384 | #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) |
| 385 | #define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value)) | ||
| 422 | 386 | ||
| 423 | #define XSETINT(a, b) XSET (a, Lisp_Int, b) | 387 | #define XSETINT(a, b) XSET (a, Lisp_Int, b) |
| 424 | #define XSETCONS(a, b) XSET (a, Lisp_Cons, b) | 388 | #define XSETCONS(a, b) XSET (a, Lisp_Cons, b) |
| @@ -609,6 +573,50 @@ struct Lisp_Buffer_Objfwd | |||
| 609 | int offset; | 573 | int offset; |
| 610 | }; | 574 | }; |
| 611 | 575 | ||
| 576 | /* Used in a symbol value cell when the symbol's value is per-buffer. | ||
| 577 | The actual contents resemble a cons cell which starts a list like this: | ||
| 578 | (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). | ||
| 579 | |||
| 580 | BUFFER is the last buffer for which this symbol's value was | ||
| 581 | made up to date. | ||
| 582 | |||
| 583 | CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's | ||
| 584 | local_var_alist, that being the element whose car is this | ||
| 585 | variable. Or it can be a pointer to the | ||
| 586 | (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), | ||
| 587 | if BUFFER does not have an element in its alist for this | ||
| 588 | variable (that is, if BUFFER sees the default value of this | ||
| 589 | variable). | ||
| 590 | |||
| 591 | If we want to examine or set the value and BUFFER is current, | ||
| 592 | we just examine or set REALVALUE. If BUFFER is not current, we | ||
| 593 | store the current REALVALUE value into CURRENT-ALIST-ELEMENT, | ||
| 594 | then find the appropriate alist element for the buffer now | ||
| 595 | current and set up CURRENT-ALIST-ELEMENT. Then we set | ||
| 596 | REALVALUE out of that element, and store into BUFFER. | ||
| 597 | |||
| 598 | If we are setting the variable and the current buffer does not | ||
| 599 | have an alist entry for this variable, an alist entry is | ||
| 600 | created. | ||
| 601 | |||
| 602 | Note that REALVALUE can be a forwarding pointer. Each time it | ||
| 603 | is examined or set, forwarding must be done. Each time we | ||
| 604 | switch buffers, buffer-local variables which forward into C | ||
| 605 | variables are swapped immediately, so the C code can assume | ||
| 606 | that they are always up to date. | ||
| 607 | |||
| 608 | Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value | ||
| 609 | use the same substructure. The difference is that with the latter, | ||
| 610 | merely setting the variable while some buffer is current | ||
| 611 | does not cause that buffer to have its own local value of this variable. | ||
| 612 | Only make-local-variable does that. */ | ||
| 613 | struct Lisp_Buffer_Local_Value | ||
| 614 | { | ||
| 615 | enum Lisp_Misc_Type type; /* = Lisp_Misc_Buffer_Local_Value | ||
| 616 | or Lisp_Misc_Some_Buffer_Local_Value */ | ||
| 617 | Lisp_Object car, cdr; | ||
| 618 | }; | ||
| 619 | |||
| 612 | union Lisp_Misc | 620 | union Lisp_Misc |
| 613 | { | 621 | { |
| 614 | enum Lisp_Misc_Type type; | 622 | enum Lisp_Misc_Type type; |
| @@ -618,6 +626,7 @@ union Lisp_Misc | |||
| 618 | struct Lisp_Boolfwd u_boolfwd; | 626 | struct Lisp_Boolfwd u_boolfwd; |
| 619 | struct Lisp_Objfwd u_objfwd; | 627 | struct Lisp_Objfwd u_objfwd; |
| 620 | struct Lisp_Buffer_Objfwd u_buffer_objfwd; | 628 | struct Lisp_Buffer_Objfwd u_buffer_objfwd; |
| 629 | struct Lisp_Buffer_Local_Value u_buffer_local_value; | ||
| 621 | }; | 630 | }; |
| 622 | 631 | ||
| 623 | #ifdef LISP_FLOAT_TYPE | 632 | #ifdef LISP_FLOAT_TYPE |
| @@ -761,13 +770,13 @@ typedef unsigned char UCHAR; | |||
| 761 | #define FLOATP(x) (0) | 770 | #define FLOATP(x) (0) |
| 762 | #endif | 771 | #endif |
| 763 | #define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay) | 772 | #define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay) |
| 764 | #define BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Buffer_Local_Value) | ||
| 765 | #define SOME_BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Some_Buffer_Local_Value) | ||
| 766 | #define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker) | 773 | #define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker) |
| 767 | #define INTFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd) | 774 | #define INTFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd) |
| 768 | #define BOOLFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd) | 775 | #define BOOLFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd) |
| 769 | #define OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd) | 776 | #define OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd) |
| 770 | #define BUFFER_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd) | 777 | #define BUFFER_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd) |
| 778 | #define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Local_Value) | ||
| 779 | #define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Some_Buffer_Local_Value) | ||
| 771 | 780 | ||
| 772 | #define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) | 781 | #define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) |
| 773 | #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) | 782 | #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) |