aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorGerd Möllmann2025-01-08 04:04:49 +0100
committerGerd Möllmann2025-01-08 04:04:49 +0100
commit2838be3fd554cf5965967e873a52c1e69363f170 (patch)
treea88bd632c1e33c2f304c81cfe1922da7dcad7cb9 /src/buffer.c
parent2117baac06d6ed7aa84aa12870de2a9e2942a77e (diff)
parent601a1f1f2797488ea40292c27945fbfbe1bc3241 (diff)
downloademacs-2838be3fd554cf5965967e873a52c1e69363f170.tar.gz
emacs-2838be3fd554cf5965967e873a52c1e69363f170.zip
Merge branch 'master' into scratch/igc
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 5d33c00ef73..0b2899938b2 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,6 +1,6 @@
1/* Buffer manipulation primitives for GNU Emacs. 1/* Buffer manipulation primitives for GNU Emacs.
2 2
3Copyright (C) 1985-2024 Free Software Foundation, Inc. 3Copyright (C) 1985-2025 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -112,7 +112,7 @@ static int last_per_buffer_idx;
112static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, 112static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
113 bool after, Lisp_Object arg1, 113 bool after, Lisp_Object arg1,
114 Lisp_Object arg2, Lisp_Object arg3); 114 Lisp_Object arg2, Lisp_Object arg3);
115static void reset_buffer_local_variables (struct buffer *, bool); 115static void reset_buffer_local_variables (struct buffer *, int);
116 116
117/* Alist of all buffer names vs the buffers. This used to be 117/* Alist of all buffer names vs the buffers. This used to be
118 a Lisp-visible variable, but is no longer, to prevent lossage 118 a Lisp-visible variable, but is no longer, to prevent lossage
@@ -1114,10 +1114,11 @@ reset_buffer (register struct buffer *b)
1114 Instead, use Fkill_all_local_variables. 1114 Instead, use Fkill_all_local_variables.
1115 1115
1116 If PERMANENT_TOO, reset permanent buffer-local variables. 1116 If PERMANENT_TOO, reset permanent buffer-local variables.
1117 If not, preserve those. */ 1117 If not, preserve those. PERMANENT_TOO = 2 means ignore
1118 the permanent-local property of non-builtin variables. */
1118 1119
1119static void 1120static void
1120reset_buffer_local_variables (struct buffer *b, bool permanent_too) 1121reset_buffer_local_variables (struct buffer *b, int permanent_too)
1121{ 1122{
1122 int offset, i; 1123 int offset, i;
1123 1124
@@ -1143,7 +1144,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
1143 bset_invisibility_spec (b, Qt); 1144 bset_invisibility_spec (b, Qt);
1144 1145
1145 /* Reset all (or most) per-buffer variables to their defaults. */ 1146 /* Reset all (or most) per-buffer variables to their defaults. */
1146 if (permanent_too) 1147 if (permanent_too == 1)
1147 bset_local_var_alist (b, Qnil); 1148 bset_local_var_alist (b, Qnil);
1148 else 1149 else
1149 { 1150 {
@@ -1172,7 +1173,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
1172 swap_in_global_binding (XSYMBOL (sym)); 1173 swap_in_global_binding (XSYMBOL (sym));
1173 } 1174 }
1174 1175
1175 if (!NILP (prop)) 1176 if (!NILP (prop) && !permanent_too)
1176 { 1177 {
1177 /* If permanent-local, keep it. */ 1178 /* If permanent-local, keep it. */
1178 last = tmp; 1179 last = tmp;
@@ -3044,7 +3045,7 @@ the normal hook `change-major-mode-hook'. */)
3044 3045
3045 /* Actually eliminate all local bindings of this buffer. */ 3046 /* Actually eliminate all local bindings of this buffer. */
3046 3047
3047 reset_buffer_local_variables (current_buffer, !NILP (kill_permanent)); 3048 reset_buffer_local_variables (current_buffer, !NILP (kill_permanent) ? 2 : 0);
3048 3049
3049 /* Force mode-line redisplay. Useful here because all major mode 3050 /* Force mode-line redisplay. Useful here because all major mode
3050 commands call this function. */ 3051 commands call this function. */