all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* change-major-mode-hook
@ 2006-08-05 19:04 Chong Yidong
  2006-08-06  4:43 ` change-major-mode-hook Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Chong Yidong @ 2006-08-05 19:04 UTC (permalink / raw)


Is there any deep reason why change-major-mode-hook isn't explicitly
defined?  How about this patch?

*** emacs/src/buffer.c.~1.505.~	2006-07-18 09:35:12.000000000 -0400
--- emacs/src/buffer.c	2006-08-05 15:02:26.000000000 -0400
***************
*** 146,151 ****
--- 146,154 ----
  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,2392 ****
    Lisp_Object oalist;
  
    if (!NILP (Vrun_hooks))
!     call1 (Vrun_hooks, intern ("change-major-mode-hook"));
    oalist = current_buffer->local_var_alist;
  
    /* Make sure none of the bindings in oalist
--- 2389,2395 ----
    Lisp_Object oalist;
  
    if (!NILP (Vrun_hooks))
!     call1 (Vrun_hooks, Qchange_major_mode_hook);
    oalist = current_buffer->local_var_alist;
  
    /* Make sure none of the bindings in oalist
***************
*** 5998,6003 ****
--- 6001,6013 ----
  	       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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: change-major-mode-hook
  2006-08-05 19:04 change-major-mode-hook Chong Yidong
@ 2006-08-06  4:43 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2006-08-06  4:43 UTC (permalink / raw)
  Cc: emacs-devel

Ok with me.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-06  4:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-05 19:04 change-major-mode-hook Chong Yidong
2006-08-06  4:43 ` change-major-mode-hook Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.