emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/buffer.c,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/buffer.c,v
Date: Sun, 06 Aug 2006 14:22:25 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      06/08/06 14:22:24

Index: buffer.c
===================================================================
RCS file: /sources/emacs/emacs/src/buffer.c,v
retrieving revision 1.505
retrieving revision 1.506
diff -u -b -r1.505 -r1.506
--- buffer.c    18 Jul 2006 13:25:47 -0000      1.505
+++ buffer.c    6 Aug 2006 14:22:24 -0000       1.506
@@ -146,6 +146,9 @@
 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 @@
   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 @@
               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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]