aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorjakanakaevangeli2021-07-20 16:31:24 +0200
committerLars Ingebrigtsen2021-07-20 16:31:24 +0200
commitb4fabb316dfe59c75525cd37eaf87020582a9d12 (patch)
tree2b00e41dfd40baa999f424835f8ed5610bdc24d3 /src/buffer.c
parentc175ad52faae49a10a7c04c79a7ca88d68c551b4 (diff)
downloademacs-b4fabb316dfe59c75525cd37eaf87020582a9d12.tar.gz
emacs-b4fabb316dfe59c75525cd37eaf87020582a9d12.zip
Make `kill-all-local-variables' also remove lambda from hooks
* src/buffer.c (reset_buffer_local_variables): Also remove non-symbol elements from hook variables (bug#46407).
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 335523de604..b177c5eaa7f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1084,12 +1084,12 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
1084 for (newlist = Qnil; CONSP (list); list = XCDR (list)) 1084 for (newlist = Qnil; CONSP (list); list = XCDR (list))
1085 { 1085 {
1086 Lisp_Object elt = XCAR (list); 1086 Lisp_Object elt = XCAR (list);
1087 /* Preserve element ELT if it's t, 1087 /* Preserve element ELT if it's t, or if it is a
1088 if it is a function with a `permanent-local-hook' property, 1088 function with a `permanent-local-hook'
1089 or if it's not a symbol. */ 1089 property. */
1090 if (! SYMBOLP (elt) 1090 if (EQ (elt, Qt)
1091 || EQ (elt, Qt) 1091 || (SYMBOLP (elt)
1092 || !NILP (Fget (elt, Qpermanent_local_hook))) 1092 && !NILP (Fget (elt, Qpermanent_local_hook))))
1093 newlist = Fcons (elt, newlist); 1093 newlist = Fcons (elt, newlist);
1094 } 1094 }
1095 newlist = Fnreverse (newlist); 1095 newlist = Fnreverse (newlist);