summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-06-19 14:49:50 +0800
committerChong Yidong <cyd@gnu.org>2012-06-19 14:49:50 +0800
commitc6bf30222430f41fbb696e296f0f63f465eefc35 (patch)
tree257eb724e088a7e5e321170ce078cc0e3efc5f6e /src/term.c
parent4e2cc2f31f8e516901bc3cacf98def678cd45dc9 (diff)
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 3a41552c02..5f80718119 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,
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). This function always returns nil if
-TERMINAL does not refer to a text-only terminal. */)
+TERMINAL does not refer to a text terminal. */)
(Lisp_Object terminal)
{
struct terminal *t = get_tty_terminal (terminal, 0);
@@ -2149,7 +2149,7 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). This function always returns 0 if
-TERMINAL does not refer to a text-only terminal. */)
+TERMINAL does not refer to a text terminal. */)
(Lisp_Object terminal)
{
struct terminal *t = get_tty_terminal (terminal, 0);
@@ -2371,7 +2371,7 @@ no effect if used on a non-tty terminal.
TERMINAL can be a terminal object, a frame or nil (meaning the
selected frame's terminal). This function always returns nil if
-TERMINAL does not refer to a text-only terminal. */)
+TERMINAL does not refer to a text terminal. */)
(Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
@@ -2381,6 +2381,21 @@ TERMINAL does not refer to a text-only terminal. */)
return Qnil;
}
+DEFUN ("tty-top-frame", Ftty_top_frame, Stty_top_frame, 0, 1, 0,
+ doc: /* Return the topmost terminal frame on TERMINAL.
+TERMINAL can be a terminal object, a frame or nil (meaning the
+selected frame's terminal). This function returns nil if TERMINAL
+does not refer to a text terminal. Otherwise, it returns the
+top-most frame on the text terminal. */)
+ (Lisp_Object terminal)
+{
+ struct terminal *t = get_terminal (terminal, 1);
+
+ if (t->type == output_termcap)
+ return t->display_info.tty->top_frame;
+ return Qnil;
+}
+
DEFUN ("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. */);
defsubr (&Stty_no_underline);
defsubr (&Stty_type);
defsubr (&Scontrolling_tty_p);
+ defsubr (&Stty_top_frame);
defsubr (&Ssuspend_tty);
defsubr (&Sresume_tty);
#ifdef HAVE_GPM