comparison src/buffer.c @ 72299:e97bfa736263

* buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. (Fkill_all_local_variables): Use it. (syms_of_buffer): Defvar it.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 06 Aug 2006 14:22:24 +0000
parents b0505e901bff
children c5d047643872 7f3f771c85fa
comparison
equal deleted inserted replaced
72298:def249a807ea 72299:e97bfa736263
143 143
144 /* List of functions to call that can query about killing a buffer. 144 /* List of functions to call that can query about killing a buffer.
145 If any of these functions returns nil, we don't kill it. */ 145 If any of these functions returns nil, we don't kill it. */
146 Lisp_Object Vkill_buffer_query_functions; 146 Lisp_Object Vkill_buffer_query_functions;
147 Lisp_Object Qkill_buffer_query_functions; 147 Lisp_Object Qkill_buffer_query_functions;
148
149 /* Hook run before changing a major mode. */
150 Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook;
148 151
149 /* List of functions to call before changing an unmodified buffer. */ 152 /* List of functions to call before changing an unmodified buffer. */
150 Lisp_Object Vfirst_change_hook; 153 Lisp_Object Vfirst_change_hook;
151 154
152 Lisp_Object Qfirst_change_hook; 155 Lisp_Object Qfirst_change_hook;
2384 { 2387 {
2385 register Lisp_Object alist, sym, tem; 2388 register Lisp_Object alist, sym, tem;
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
2393 remain swapped in, in their symbols. */ 2396 remain swapped in, in their symbols. */
2394 2397
5996 5999
5997 DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, 6000 DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions,
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.
6006 The 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);
6004 defsubr (&Sget_file_buffer); 6014 defsubr (&Sget_file_buffer);
6005 defsubr (&Sget_buffer_create); 6015 defsubr (&Sget_buffer_create);