diff options
| author | Stefan Monnier | 2007-11-22 19:48:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-11-22 19:48:57 +0000 |
| commit | 569c11e30659c45af971a5e02df008cb238fcaa5 (patch) | |
| tree | ec660da0671e1b7dc8295f6126db064306dab330 /src/data.c | |
| parent | 693b2fe29632bd80290ccc9843c3ea3766d3ae54 (diff) | |
| download | emacs-569c11e30659c45af971a5e02df008cb238fcaa5.tar.gz emacs-569c11e30659c45af971a5e02df008cb238fcaa5.zip | |
(set_internal): Set the value in the `cons-cell' (for
Buffer_Local_values) not only for frame-local variables.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/data.c b/src/data.c index faf3bc8df9b..787e81c9aed 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1238,6 +1238,7 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1238 | || buf != XBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer) | 1238 | || buf != XBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer) |
| 1239 | || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame | 1239 | || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame |
| 1240 | && !EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame)) | 1240 | && !EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame)) |
| 1241 | /* Also unload a global binding (if the var is local_if_set). */ | ||
| 1241 | || (EQ (XCAR (current_alist_element), | 1242 | || (EQ (XCAR (current_alist_element), |
| 1242 | current_alist_element))) | 1243 | current_alist_element))) |
| 1243 | { | 1244 | { |
| @@ -1257,7 +1258,7 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1257 | { | 1258 | { |
| 1258 | /* This buffer still sees the default value. */ | 1259 | /* This buffer still sees the default value. */ |
| 1259 | 1260 | ||
| 1260 | /* If the variable is a Lisp_Some_Buffer_Local_Value, | 1261 | /* If the variable is not local_if_set, |
| 1261 | or if this is `let' rather than `set', | 1262 | or if this is `let' rather than `set', |
| 1262 | make CURRENT-ALIST-ELEMENT point to itself, | 1263 | make CURRENT-ALIST-ELEMENT point to itself, |
| 1263 | indicating that we're seeing the default value. | 1264 | indicating that we're seeing the default value. |
| @@ -1298,6 +1299,9 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1298 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; | 1299 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; |
| 1299 | } | 1300 | } |
| 1300 | innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue; | 1301 | innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue; |
| 1302 | |||
| 1303 | /* Store the new value in the cons-cell. */ | ||
| 1304 | XSETCDR (XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr), newval); | ||
| 1301 | } | 1305 | } |
| 1302 | 1306 | ||
| 1303 | /* If storing void (making the symbol void), forward only through | 1307 | /* If storing void (making the symbol void), forward only through |
| @@ -1307,24 +1311,6 @@ set_internal (symbol, newval, buf, bindflag) | |||
| 1307 | else | 1311 | else |
| 1308 | store_symval_forwarding (symbol, innercontents, newval, buf); | 1312 | store_symval_forwarding (symbol, innercontents, newval, buf); |
| 1309 | 1313 | ||
| 1310 | /* If we just set a variable whose current binding is frame-local, | ||
| 1311 | store the new value in the frame parameter too. */ | ||
| 1312 | |||
| 1313 | if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1314 | { | ||
| 1315 | /* What binding is loaded right now? */ | ||
| 1316 | current_alist_element | ||
| 1317 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | ||
| 1318 | |||
| 1319 | /* If the current buffer is not the buffer whose binding is | ||
| 1320 | loaded, or if there may be frame-local bindings and the frame | ||
| 1321 | isn't the right one, or if it's a Lisp_Buffer_Local_Value and | ||
| 1322 | the default binding is loaded, the loaded binding may be the | ||
| 1323 | wrong one. */ | ||
| 1324 | if (XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) | ||
| 1325 | XSETCDR (current_alist_element, newval); | ||
| 1326 | } | ||
| 1327 | |||
| 1328 | return newval; | 1314 | return newval; |
| 1329 | } | 1315 | } |
| 1330 | 1316 | ||