diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2007-09-21 20:19:10 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2007-09-21 20:19:10 +0000 |
commit | 23d4cba5c7601c1a3bb3d2c79e535dab8d9adac0 (patch) | |
tree | 1b638a1e924d8a7af594c2ceb392e3d7932ba645 | |
parent | 71f44e7ad49b434c191a84fcd46a7dfa94894735 (diff) | |
download | emacs-23d4cba5c7601c1a3bb3d2c79e535dab8d9adac0.tar.gz emacs-23d4cba5c7601c1a3bb3d2c79e535dab8d9adac0.tar.bz2 emacs-23d4cba5c7601c1a3bb3d2c79e535dab8d9adac0.zip |
* 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.
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/xt-mouse.el | 15 | ||||
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/term.c | 19 |
4 files changed, 24 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ef920fda5bb..d81faec84fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-09-21 Dan Nicolaescu <dann@ics.uci.edu> + + * xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions. + 2007-09-21 Juanma Barranquero <lekktu@gmail.com> * frame.el (suspend-frame): Call `iconify-or-deiconify-frame' also diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 49f1886f878..15aebb08ab2 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -214,15 +214,8 @@ down the SHIFT key while pressing the mouse button." (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 @@ down the SHIFT key while pressing the mouse button." (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 --git a/src/ChangeLog b/src/ChangeLog index 5e31ba344fd..3d3b64588e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-09-21 Dan Nicolaescu <dann@ics.uci.edu> + + * term.c (Fsuspend_tty): Run suspend-tty-functions before cleaning + up the tty state. + 2007-09-21 Stefan Monnier <monnier@iro.umontreal.ca> * termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead. diff --git a/src/term.c b/src/term.c index 160e387e98d..be3430574f7 100644 --- a/src/term.c +++ b/src/term.c @@ -2244,6 +2244,17 @@ A suspended tty may be resumed by calling `resume-tty' on it. */) 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 @@ A suspended tty may be resumed by calling `resume-tty' on it. */) 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. */ |