aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorChong Yidong2012-06-19 14:49:50 +0800
committerChong Yidong2012-06-19 14:49:50 +0800
commitc6bf30222430f41fbb696e296f0f63f465eefc35 (patch)
tree257eb724e088a7e5e321170ce078cc0e3efc5f6e /src/term.c
parent4e2cc2f31f8e516901bc3cacf98def678cd45dc9 (diff)
downloademacs-c6bf30222430f41fbb696e296f0f63f465eefc35.tar.gz
emacs-c6bf30222430f41fbb696e296f0f63f465eefc35.zip
Preserve tty top-frames under various window-changing operations.
* subr.el (with-selected-window): Preserve the selected window's terminal's top-frame. * window.el (save-selected-window): Likewise. * frame.c (delete_frame): When selecting a frame on a different text terminal, do not alter the terminal's top-frame. * term.c (Ftty_top_frame): New function. * xdisp.c (format_mode_line_unwind_data): Record the target frame's selected window and its terminal's top-frame. (unwind_format_mode_line): Restore them. (x_consider_frame_title, display_mode_line, Fformat_mode_line): Callers changed. (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM, since tty frames can be explicitly named. (prepare_menu_bars): Likewise. Fixes: debbugs:4702
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index 3a41552c02e..5f807181199 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2132,7 +2132,7 @@ DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
2132 2132
2133TERMINAL can be a terminal object, a frame, or nil (meaning the 2133TERMINAL can be a terminal object, a frame, or nil (meaning the
2134selected frame's terminal). This function always returns nil if 2134selected frame's terminal). This function always returns nil if
2135TERMINAL does not refer to a text-only terminal. */) 2135TERMINAL does not refer to a text terminal. */)
2136 (Lisp_Object terminal) 2136 (Lisp_Object terminal)
2137{ 2137{
2138 struct terminal *t = get_tty_terminal (terminal, 0); 2138 struct terminal *t = get_tty_terminal (terminal, 0);
@@ -2149,7 +2149,7 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
2149 2149
2150TERMINAL can be a terminal object, a frame, or nil (meaning the 2150TERMINAL can be a terminal object, a frame, or nil (meaning the
2151selected frame's terminal). This function always returns 0 if 2151selected frame's terminal). This function always returns 0 if
2152TERMINAL does not refer to a text-only terminal. */) 2152TERMINAL does not refer to a text terminal. */)
2153 (Lisp_Object terminal) 2153 (Lisp_Object terminal)
2154{ 2154{
2155 struct terminal *t = get_tty_terminal (terminal, 0); 2155 struct terminal *t = get_tty_terminal (terminal, 0);
@@ -2371,7 +2371,7 @@ no effect if used on a non-tty terminal.
2371 2371
2372TERMINAL can be a terminal object, a frame or nil (meaning the 2372TERMINAL can be a terminal object, a frame or nil (meaning the
2373selected frame's terminal). This function always returns nil if 2373selected frame's terminal). This function always returns nil if
2374TERMINAL does not refer to a text-only terminal. */) 2374TERMINAL does not refer to a text terminal. */)
2375 (Lisp_Object terminal) 2375 (Lisp_Object terminal)
2376{ 2376{
2377 struct terminal *t = get_terminal (terminal, 1); 2377 struct terminal *t = get_terminal (terminal, 1);
@@ -2381,6 +2381,21 @@ TERMINAL does not refer to a text-only terminal. */)
2381 return Qnil; 2381 return Qnil;
2382} 2382}
2383 2383
2384DEFUN ("tty-top-frame", Ftty_top_frame, Stty_top_frame, 0, 1, 0,
2385 doc: /* Return the topmost terminal frame on TERMINAL.
2386TERMINAL can be a terminal object, a frame or nil (meaning the
2387selected frame's terminal). This function returns nil if TERMINAL
2388does not refer to a text terminal. Otherwise, it returns the
2389top-most frame on the text terminal. */)
2390 (Lisp_Object terminal)
2391{
2392 struct terminal *t = get_terminal (terminal, 1);
2393
2394 if (t->type == output_termcap)
2395 return t->display_info.tty->top_frame;
2396 return Qnil;
2397}
2398
2384 2399
2385 2400
2386DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0, 2401DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0,
@@ -3638,6 +3653,7 @@ bigger, or it may make it blink, or it may do nothing at all. */);
3638 defsubr (&Stty_no_underline); 3653 defsubr (&Stty_no_underline);
3639 defsubr (&Stty_type); 3654 defsubr (&Stty_type);
3640 defsubr (&Scontrolling_tty_p); 3655 defsubr (&Scontrolling_tty_p);
3656 defsubr (&Stty_top_frame);
3641 defsubr (&Ssuspend_tty); 3657 defsubr (&Ssuspend_tty);
3642 defsubr (&Sresume_tty); 3658 defsubr (&Sresume_tty);
3643#ifdef HAVE_GPM 3659#ifdef HAVE_GPM