]> git.eshelyaron.com Git - emacs.git/commitdiff
* buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars.
authorChong Yidong <cyd@stupidchicken.com>
Sun, 6 Aug 2006 14:22:24 +0000 (14:22 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 6 Aug 2006 14:22:24 +0000 (14:22 +0000)
(Fkill_all_local_variables): Use it.
(syms_of_buffer): Defvar it.

src/ChangeLog
src/buffer.c

index 80d99505c4424916e28a92bf62053fb0d506992a..2e0563e44a7564a663b7398deb6acfaf5c7eef5c 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-06  Chong Yidong  <cyd@stupidchicken.com>
+
+       * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars.
+       (Fkill_all_local_variables): Use it.
+       (syms_of_buffer): Defvar it.
+
 2006-08-05  Eli Zaretskii  <eliz@gnu.org>
 
        * w32.c (w32_valid_pointer_p): New function.
index fcb842de83c547b03e39025c9936e01b77539e1f..3502afc9bf01d716f942f9a9948ac69579b5bfe2 100644 (file)
@@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only;
 Lisp_Object Vkill_buffer_query_functions;
 Lisp_Object Qkill_buffer_query_functions;
 
+/* Hook run before changing a major mode.  */
+Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook;
+
 /* List of functions to call before changing an unmodified buffer.  */
 Lisp_Object Vfirst_change_hook;
 
@@ -2386,7 +2389,7 @@ the normal hook `change-major-mode-hook'.  */)
   Lisp_Object oalist;
 
   if (!NILP (Vrun_hooks))
-    call1 (Vrun_hooks, intern ("change-major-mode-hook"));
+    call1 (Vrun_hooks, Qchange_major_mode_hook);
   oalist = current_buffer->local_var_alist;
 
   /* Make sure none of the bindings in oalist
@@ -5998,6 +6001,13 @@ t means to use hollow box cursor.  See `cursor-type' for other values.  */);
               doc: /* List of functions called with no args to query before killing a buffer.  */);
   Vkill_buffer_query_functions = Qnil;
 
+  DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook,
+              doc: /* Normal hook run before changing the major mode of a buffer.
+The function `kill-all-local-variables' runs this before doing anything else.  */);
+  Vchange_major_mode_hook = Qnil;
+  Qchange_major_mode_hook = intern ("change-major-mode-hook");
+  staticpro (&Qchange_major_mode_hook);
+
   defsubr (&Sbuffer_live_p);
   defsubr (&Sbuffer_list);
   defsubr (&Sget_buffer);