aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2000-02-20 14:30:15 +0000
committerRichard M. Stallman2000-02-20 14:30:15 +0000
commit65d0110b8559bf1c6dc734f2c376cbe6c384d223 (patch)
treed7503b35e0b3812e7472c74c152dcf9734f5557b /src
parent42e975f059a12ff057a204cae38750436452957d (diff)
downloademacs-65d0110b8559bf1c6dc734f2c376cbe6c384d223.tar.gz
emacs-65d0110b8559bf1c6dc734f2c376cbe6c384d223.zip
Comment changes.
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h91
1 files changed, 50 insertions, 41 deletions
diff --git a/src/lisp.h b/src/lisp.h
index a398c9a581a..6188ef11e56 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -936,56 +936,63 @@ struct Lisp_Buffer_Objfwd
936 int offset; 936 int offset;
937 }; 937 };
938 938
939/* Used in a symbol value cell when the symbol's value is per-buffer. 939/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when
940 The actual contents resemble a cons cell which starts a list like this: 940 the symbol has buffer-local or frame-local bindings. (Exception:
941 (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE). 941 some buffer-local variables are built-in, with their values stored
942 942 in the buffer structure itself. They are handled differently,
943 The cons-like structure is for historical reasons; it might be better 943 using struct Lisp_Buffer_Objfwd.)
944 to just put these elements into the struct, now. 944
945 945 The `realvalue' slot holds the variable's current value, or a
946 BUFFER is the last buffer for which this symbol's value was 946 forwarding pointer to where that value is kept. This value is the
947 made up to date. 947 one that corresponds to the loaded binding. To read or set the
948 948 variable, you must first make sure the right binding is loaded;
949 CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's 949 then you can access the value in (or through) `realvalue'.
950 local_var_alist, that being the element whose car is this 950
951 variable. Or it can be a pointer to the 951 `buffer' and `frame' are the buffer and frame for which the loaded
952 (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE), 952 binding was found. If those have changed, to make sure the right
953 if BUFFER does not have an element in its alist for this 953 binding is loaded it is necessary to find which binding goes with
954 variable (that is, if BUFFER sees the default value of this 954 the current buffer and selected frame, then load it. To load it,
955 variable). 955 first unload the previous binding, then copy the value of the new
956 956 binding into `realvalue' (or through it). Also update
957 If we want to examine or set the value and BUFFER is current, 957 LOADED-BINDING to point to the newly loaded binding.
958 we just examine or set REALVALUE. If BUFFER is not current, we
959 store the current REALVALUE value into CURRENT-ALIST-ELEMENT,
960 then find the appropriate alist element for the buffer now
961 current and set up CURRENT-ALIST-ELEMENT. Then we set
962 REALVALUE out of that element, and store into BUFFER.
963
964 If we are setting the variable and the current buffer does not
965 have an alist entry for this variable, an alist entry is
966 created.
967
968 Note that REALVALUE can be a forwarding pointer. Each time it
969 is examined or set, forwarding must be done. Each time we
970 switch buffers, buffer-local variables which forward into C
971 variables are swapped immediately, so the C code can assume
972 that they are always up to date.
973 958
974 Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value 959 Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value
975 use the same substructure. The difference is that with the latter, 960 both use this kind of structure. With the former, merely setting
976 merely setting the variable while some buffer is current 961 the variable creates a local binding for the current buffer. With
977 does not cause that buffer to have its own local value of this variable. 962 the latter, setting the variable does not do that; only
978 Only make-local-variable does that. */ 963 make-local-variable does that. */
964
979struct Lisp_Buffer_Local_Value 965struct Lisp_Buffer_Local_Value
980 { 966 {
981 int type : 16; /* = Lisp_Misc_Buffer_Local_Value 967 int type : 16; /* = Lisp_Misc_Buffer_Local_Value
982 or Lisp_Misc_Some_Buffer_Local_Value */ 968 or Lisp_Misc_Some_Buffer_Local_Value */
983 int spacer : 13; 969 int spacer : 13;
970
971 /* 1 means this variable is allowed to have frame-local bindings,
972 so check for them when looking for the proper binding. */
984 unsigned int check_frame : 1; 973 unsigned int check_frame : 1;
974 /* 1 means that the binding now loaded was found
975 as a local binding for the buffer in the `buffer' slot. */
985 unsigned int found_for_buffer : 1; 976 unsigned int found_for_buffer : 1;
977 /* 1 means that the binding now loaded was found
978 as a local binding for the frame in the `frame' slot. */
986 unsigned int found_for_frame : 1; 979 unsigned int found_for_frame : 1;
987 Lisp_Object realvalue; 980 Lisp_Object realvalue;
981 /* The buffer and frame for which the loaded binding was found. */
988 Lisp_Object buffer, frame; 982 Lisp_Object buffer, frame;
983
984 /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE).
985
986 LOADED-BINDING is the binding now loaded. It is a cons cell
987 whose cdr is the binding's value. The cons cell may be an
988 element of a buffer's local-variable alist, or an element of a
989 frame's parameter alist, or it may be this cons cell.
990
991 DEFAULT-VALUE is the variable's default value, seen when the
992 current buffer and selected frame do not have their own
993 bindings for the variable. When the default binding is loaded,
994 LOADED-BINDING is actually this very cons cell; thus, its car
995 points to itself. */
989 Lisp_Object cdr; 996 Lisp_Object cdr;
990 }; 997 };
991 998
@@ -1430,9 +1437,11 @@ extern void defvar_kboard P_ ((char *, int));
1430 1437
1431 Otherwise, the element is a variable binding. 1438 Otherwise, the element is a variable binding.
1432 If the symbol field is a symbol, it is an ordinary variable binding. 1439 If the symbol field is a symbol, it is an ordinary variable binding.
1433 Otherwise, it should be a cons cell (SYMBOL . BUFFER) 1440 Otherwise, it should be a structure (SYMBOL BUFFER . BUFFER),
1434 which represents having bound BUFFER's local value. 1441 which represents having bound BUFFER's local value,
1435 or (SYMBOL . nil), which represents having bound the default value. */ 1442 or (SYMBOL nil . BUFFER), which represents having bound the default
1443 value when BUFFER was current (buffer not having any local binding
1444 for SYMBOL). */
1436 1445
1437struct specbinding 1446struct specbinding
1438 { 1447 {