diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c index 90c5efdfbf7..2955ee6399b 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -111,7 +111,7 @@ static int last_per_buffer_idx; | |||
| 111 | static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, | 111 | static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, |
| 112 | bool after, Lisp_Object arg1, | 112 | bool after, Lisp_Object arg1, |
| 113 | Lisp_Object arg2, Lisp_Object arg3); | 113 | Lisp_Object arg2, Lisp_Object arg3); |
| 114 | static void reset_buffer_local_variables (struct buffer *, bool); | 114 | static void reset_buffer_local_variables (struct buffer *, int); |
| 115 | 115 | ||
| 116 | /* Alist of all buffer names vs the buffers. This used to be | 116 | /* Alist of all buffer names vs the buffers. This used to be |
| 117 | a Lisp-visible variable, but is no longer, to prevent lossage | 117 | a Lisp-visible variable, but is no longer, to prevent lossage |
| @@ -1110,10 +1110,11 @@ reset_buffer (register struct buffer *b) | |||
| 1110 | Instead, use Fkill_all_local_variables. | 1110 | Instead, use Fkill_all_local_variables. |
| 1111 | 1111 | ||
| 1112 | If PERMANENT_TOO, reset permanent buffer-local variables. | 1112 | If PERMANENT_TOO, reset permanent buffer-local variables. |
| 1113 | If not, preserve those. */ | 1113 | If not, preserve those. PERMANENT_TOO = 2 means ignore |
| 1114 | the permanent-local property of non-builtin variables. */ | ||
| 1114 | 1115 | ||
| 1115 | static void | 1116 | static void |
| 1116 | reset_buffer_local_variables (struct buffer *b, bool permanent_too) | 1117 | reset_buffer_local_variables (struct buffer *b, int permanent_too) |
| 1117 | { | 1118 | { |
| 1118 | int offset, i; | 1119 | int offset, i; |
| 1119 | 1120 | ||
| @@ -1139,7 +1140,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) | |||
| 1139 | bset_invisibility_spec (b, Qt); | 1140 | bset_invisibility_spec (b, Qt); |
| 1140 | 1141 | ||
| 1141 | /* Reset all (or most) per-buffer variables to their defaults. */ | 1142 | /* Reset all (or most) per-buffer variables to their defaults. */ |
| 1142 | if (permanent_too) | 1143 | if (permanent_too == 1) |
| 1143 | bset_local_var_alist (b, Qnil); | 1144 | bset_local_var_alist (b, Qnil); |
| 1144 | else | 1145 | else |
| 1145 | { | 1146 | { |
| @@ -1168,7 +1169,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) | |||
| 1168 | swap_in_global_binding (XSYMBOL (sym)); | 1169 | swap_in_global_binding (XSYMBOL (sym)); |
| 1169 | } | 1170 | } |
| 1170 | 1171 | ||
| 1171 | if (!NILP (prop)) | 1172 | if (!NILP (prop) && !permanent_too) |
| 1172 | { | 1173 | { |
| 1173 | /* If permanent-local, keep it. */ | 1174 | /* If permanent-local, keep it. */ |
| 1174 | last = tmp; | 1175 | last = tmp; |
| @@ -3006,7 +3007,7 @@ the normal hook `change-major-mode-hook'. */) | |||
| 3006 | 3007 | ||
| 3007 | /* Actually eliminate all local bindings of this buffer. */ | 3008 | /* Actually eliminate all local bindings of this buffer. */ |
| 3008 | 3009 | ||
| 3009 | reset_buffer_local_variables (current_buffer, !NILP (kill_permanent)); | 3010 | reset_buffer_local_variables (current_buffer, !NILP (kill_permanent) ? 2 : 0); |
| 3010 | 3011 | ||
| 3011 | /* Force mode-line redisplay. Useful here because all major mode | 3012 | /* Force mode-line redisplay. Useful here because all major mode |
| 3012 | commands call this function. */ | 3013 | commands call this function. */ |