diff options
| author | Gerd Moellmann | 2000-06-19 12:12:35 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-06-19 12:12:35 +0000 |
| commit | 4c47c973628be87cc4d1b926acf4879f36c62185 (patch) | |
| tree | c8ea670949c757a05a18aa20c17b21583643d589 /src/data.c | |
| parent | ead0e4e0dd0913aea089720c0bf5c62085eb9e5c (diff) | |
| download | emacs-4c47c973628be87cc4d1b926acf4879f36c62185.tar.gz emacs-4c47c973628be87cc4d1b926acf4879f36c62185.zip | |
(set_internal): If variable is frame-local,
store the new value immediately into the frame parameter alist.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/data.c b/src/data.c index aabed27f20a..b06d8cdec4a 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1024,7 +1024,7 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1024 | { | 1024 | { |
| 1025 | int voide = EQ (newval, Qunbound); | 1025 | int voide = EQ (newval, Qunbound); |
| 1026 | 1026 | ||
| 1027 | register Lisp_Object valcontents, tem1, current_alist_element; | 1027 | register Lisp_Object valcontents, innercontents, tem1, current_alist_element; |
| 1028 | 1028 | ||
| 1029 | if (buf == 0) | 1029 | if (buf == 0) |
| 1030 | buf = current_buffer; | 1030 | buf = current_buffer; |
| @@ -1039,7 +1039,8 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1039 | && EQ (XSYMBOL (symbol)->obarray, initial_obarray) | 1039 | && EQ (XSYMBOL (symbol)->obarray, initial_obarray) |
| 1040 | && !EQ (newval, symbol))) | 1040 | && !EQ (newval, symbol))) |
| 1041 | return Fsignal (Qsetting_constant, Fcons (symbol, Qnil)); | 1041 | return Fsignal (Qsetting_constant, Fcons (symbol, Qnil)); |
| 1042 | valcontents = XSYMBOL (symbol)->value; | 1042 | |
| 1043 | innercontents = valcontents = XSYMBOL (symbol)->value; | ||
| 1043 | 1044 | ||
| 1044 | if (BUFFER_OBJFWDP (valcontents)) | 1045 | if (BUFFER_OBJFWDP (valcontents)) |
| 1045 | { | 1046 | { |
| @@ -1130,7 +1131,7 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1130 | XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); | 1131 | XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); |
| 1131 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; | 1132 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; |
| 1132 | } | 1133 | } |
| 1133 | valcontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue; | 1134 | innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue; |
| 1134 | } | 1135 | } |
| 1135 | 1136 | ||
| 1136 | /* If storing void (making the symbol void), forward only through | 1137 | /* If storing void (making the symbol void), forward only through |
| @@ -1138,7 +1139,26 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1138 | if (voide) | 1139 | if (voide) |
| 1139 | store_symval_forwarding (symbol, Qnil, newval); | 1140 | store_symval_forwarding (symbol, Qnil, newval); |
| 1140 | else | 1141 | else |
| 1141 | store_symval_forwarding (symbol, valcontents, newval); | 1142 | store_symval_forwarding (symbol, innercontents, newval); |
| 1143 | |||
| 1144 | /* If we just set a variable whose current binding is frame-local, | ||
| 1145 | store the new value in the frame parameter too. */ | ||
| 1146 | |||
| 1147 | if (BUFFER_LOCAL_VALUEP (valcontents) | ||
| 1148 | || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1149 | { | ||
| 1150 | /* What binding is loaded right now? */ | ||
| 1151 | current_alist_element | ||
| 1152 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | ||
| 1153 | |||
| 1154 | /* If the current buffer is not the buffer whose binding is | ||
| 1155 | loaded, or if there may be frame-local bindings and the frame | ||
| 1156 | isn't the right one, or if it's a Lisp_Buffer_Local_Value and | ||
| 1157 | the default binding is loaded, the loaded binding may be the | ||
| 1158 | wrong one. */ | ||
| 1159 | if (XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) | ||
| 1160 | XCDR (current_alist_element) = newval; | ||
| 1161 | } | ||
| 1142 | 1162 | ||
| 1143 | return newval; | 1163 | return newval; |
| 1144 | } | 1164 | } |