diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/data.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c index 339302ac084..7d11d1cc803 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1007,6 +1007,8 @@ not have their own values for this variable.") | |||
| 1007 | return val; | 1007 | return val; |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| 1010 | /* Lisp functions for creating and removing buffer-local variables. */ | ||
| 1011 | |||
| 1010 | DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local, | 1012 | DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local, |
| 1011 | 1, 1, "vMake Variable Buffer Local: ", | 1013 | 1, 1, "vMake Variable Buffer Local: ", |
| 1012 | "Make VARIABLE have a separate value for each buffer.\n\ | 1014 | "Make VARIABLE have a separate value for each buffer.\n\ |
| @@ -1101,8 +1103,18 @@ just as if the variable were set.") | |||
| 1101 | if (current_buffer == XBUFFER (XCONS (XCONS (xs)->cdr)->car)) | 1103 | if (current_buffer == XBUFFER (XCONS (XCONS (xs)->cdr)->car)) |
| 1102 | XCONS (XCONS (XSYMBOL (sym)->value)->cdr)->car = Qnil; | 1104 | XCONS (XCONS (XSYMBOL (sym)->value)->cdr)->car = Qnil; |
| 1103 | } | 1105 | } |
| 1104 | |||
| 1105 | } | 1106 | } |
| 1107 | |||
| 1108 | /* If the symbol forwards into a C variable, then swap in the | ||
| 1109 | variable for this buffer immediately. If C code modifies the | ||
| 1110 | variable before we swap in, then that new value will clobber the | ||
| 1111 | default value the next time we swap. */ | ||
| 1112 | valcontents = XCONS (XSYMBOL (sym)->value)->car; | ||
| 1113 | if (XTYPE (valcontents) == Lisp_Intfwd | ||
| 1114 | || XTYPE (valcontents) == Lisp_Boolfwd | ||
| 1115 | || XTYPE (valcontents) == Lisp_Objfwd) | ||
| 1116 | swap_in_symval_forwarding (sym, XSYMBOL (sym)->value); | ||
| 1117 | |||
| 1106 | return sym; | 1118 | return sym; |
| 1107 | } | 1119 | } |
| 1108 | 1120 | ||