# HG changeset patch # User Dan Nicolaescu # Date 1190405950 0 # Node ID cbcb89640ef25b011dde7106e759b319cc43f6b6 # Parent 53194ec0578969f22e59668677433b1da9c6a615 * 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. diff -r 53194ec05789 -r cbcb89640ef2 lisp/ChangeLog --- a/lisp/ChangeLog Fri Sep 21 17:10:48 2007 +0000 +++ b/lisp/ChangeLog Fri Sep 21 20:19:10 2007 +0000 @@ -1,3 +1,7 @@ +2007-09-21 Dan Nicolaescu + + * xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions. + 2007-09-21 Juanma Barranquero * frame.el (suspend-frame): Call `iconify-or-deiconify-frame' also diff -r 53194ec05789 -r cbcb89640ef2 lisp/xt-mouse.el --- a/lisp/xt-mouse.el Fri Sep 21 17:10:48 2007 +0000 +++ b/lisp/xt-mouse.el Fri Sep 21 20:19:10 2007 +0000 @@ -214,15 +214,8 @@ (add-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame) ;; Restore normal mouse behaviour outside Emacs. - - ;; Temporarily disable this hook, it does not work, when - ;; `suspend-tty' calls `suspend-tty-functions' the tty->output - ;; is already set to 0 so the 'send-string-to-terminal' call - ;; in `turn-off-xterm-mouse-tracking-on-terminal' will result - ;; in a crash. - ;; (add-hook 'suspend-tty-functions - ;; 'turn-off-xterm-mouse-tracking-on-terminal) - + (add-hook 'suspend-tty-functions + 'turn-off-xterm-mouse-tracking-on-terminal) (add-hook 'resume-tty-functions 'turn-on-xterm-mouse-tracking-on-terminal) (add-hook 'suspend-hook 'turn-off-xterm-mouse-tracking) @@ -234,8 +227,8 @@ (remove-hook 'after-make-frame-functions 'turn-on-xterm-mouse-tracking-on-terminal) (remove-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame) - ;; (remove-hook 'suspend-tty-functions - ;; 'turn-off-xterm-mouse-tracking-on-terminal) + (remove-hook 'suspend-tty-functions + 'turn-off-xterm-mouse-tracking-on-terminal) (remove-hook 'resume-tty-functions 'turn-on-xterm-mouse-tracking-on-terminal) (remove-hook 'suspend-hook 'turn-off-xterm-mouse-tracking) diff -r 53194ec05789 -r cbcb89640ef2 src/ChangeLog --- a/src/ChangeLog Fri Sep 21 17:10:48 2007 +0000 +++ b/src/ChangeLog Fri Sep 21 20:19:10 2007 +0000 @@ -1,3 +1,8 @@ +2007-09-21 Dan Nicolaescu + + * term.c (Fsuspend_tty): Run suspend-tty-functions before cleaning + up the tty state. + 2007-09-21 Stefan Monnier * termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead. diff -r 53194ec05789 -r cbcb89640ef2 src/term.c --- 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. */