aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorChong Yidong2006-08-06 14:22:24 +0000
committerChong Yidong2006-08-06 14:22:24 +0000
commit43ed3b8da0c563a5fec8708cada2ee39411062ec (patch)
tree86495f239b9e3c4bcfb35afb4e0e3bb89c901e27 /src/buffer.c
parent4c88aa80fe64722ea85826821838c52417c162da (diff)
downloademacs-43ed3b8da0c563a5fec8708cada2ee39411062ec.tar.gz
emacs-43ed3b8da0c563a5fec8708cada2ee39411062ec.zip
* buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars.
(Fkill_all_local_variables): Use it. (syms_of_buffer): Defvar it.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index fcb842de83c..3502afc9bf0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only;
146Lisp_Object Vkill_buffer_query_functions; 146Lisp_Object Vkill_buffer_query_functions;
147Lisp_Object Qkill_buffer_query_functions; 147Lisp_Object Qkill_buffer_query_functions;
148 148
149/* Hook run before changing a major mode. */
150Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook;
151
149/* List of functions to call before changing an unmodified buffer. */ 152/* List of functions to call before changing an unmodified buffer. */
150Lisp_Object Vfirst_change_hook; 153Lisp_Object Vfirst_change_hook;
151 154
@@ -2386,7 +2389,7 @@ the normal hook `change-major-mode-hook'. */)
2386 Lisp_Object oalist; 2389 Lisp_Object oalist;
2387 2390
2388 if (!NILP (Vrun_hooks)) 2391 if (!NILP (Vrun_hooks))
2389 call1 (Vrun_hooks, intern ("change-major-mode-hook")); 2392 call1 (Vrun_hooks, Qchange_major_mode_hook);
2390 oalist = current_buffer->local_var_alist; 2393 oalist = current_buffer->local_var_alist;
2391 2394
2392 /* Make sure none of the bindings in oalist 2395 /* 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. */);
5998 doc: /* List of functions called with no args to query before killing a buffer. */); 6001 doc: /* List of functions called with no args to query before killing a buffer. */);
5999 Vkill_buffer_query_functions = Qnil; 6002 Vkill_buffer_query_functions = Qnil;
6000 6003
6004 DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook,
6005 doc: /* Normal hook run before changing the major mode of a buffer.
6006The function `kill-all-local-variables' runs this before doing anything else. */);
6007 Vchange_major_mode_hook = Qnil;
6008 Qchange_major_mode_hook = intern ("change-major-mode-hook");
6009 staticpro (&Qchange_major_mode_hook);
6010
6001 defsubr (&Sbuffer_live_p); 6011 defsubr (&Sbuffer_live_p);
6002 defsubr (&Sbuffer_list); 6012 defsubr (&Sbuffer_list);
6003 defsubr (&Sget_buffer); 6013 defsubr (&Sget_buffer);