diff src/term.c @ 84769:cbcb89640ef2

* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions. * term.c (Fsuspend_tty): Run suspend-tty-functions before cleaning up the tty state.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 21 Sep 2007 20:19:10 +0000
parents 53194ec05789
children 67e430e38471
line wrap: on
line diff
--- a/src/term.c	Fri Sep 21 17:10:48 2007 +0000
+++ b/src/term.c	Fri Sep 21 20:19:10 2007 +0000
@@ -2244,6 +2244,17 @@
   
   if (f)
     {
+      /* First run `suspend-tty-functions' and then clean up the tty
+	 state because `suspend-tty-functions' might need to change
+	 the tty state.  */
+      if (!NILP (Vrun_hooks))
+        {
+          Lisp_Object args[2];
+          args[0] = intern ("suspend-tty-functions");
+          XSETTERMINAL (args[1], t);
+          Frun_hook_with_args (2, args);
+        }
+
       reset_sys_modes (t->display_info.tty);
 
       delete_keyboard_wait_descriptor (fileno (f));
@@ -2258,14 +2269,6 @@
       if (FRAMEP (t->display_info.tty->top_frame))
         FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
       
-      /* Run `suspend-tty-functions'.  */
-      if (!NILP (Vrun_hooks))
-        {
-          Lisp_Object args[2];
-          args[0] = intern ("suspend-tty-functions");
-          XSETTERMINAL (args[1], t);
-          Frun_hook_with_args (2, args);
-        }
     }
 
   /* Clear display hooks to prevent further output.  */