diff options
| author | Chong Yidong | 2006-08-06 14:22:24 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-08-06 14:22:24 +0000 |
| commit | 43ed3b8da0c563a5fec8708cada2ee39411062ec (patch) | |
| tree | 86495f239b9e3c4bcfb35afb4e0e3bb89c901e27 | |
| parent | 4c88aa80fe64722ea85826821838c52417c162da (diff) | |
| download | emacs-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.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/buffer.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 80d99505c44..2e0563e44a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2006-08-06 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. | ||
| 4 | (Fkill_all_local_variables): Use it. | ||
| 5 | (syms_of_buffer): Defvar it. | ||
| 6 | |||
| 1 | 2006-08-05 Eli Zaretskii <eliz@gnu.org> | 7 | 2006-08-05 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * w32.c (w32_valid_pointer_p): New function. | 9 | * w32.c (w32_valid_pointer_p): New function. |
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; | |||
| 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 | 148 | ||
| 149 | /* Hook run before changing a major mode. */ | ||
| 150 | Lisp_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. */ |
| 150 | Lisp_Object Vfirst_change_hook; | 153 | Lisp_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. | ||
| 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); |