diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-02-17 08:09:33 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-02-17 08:09:33 +0000 |
commit | bb1513c9590fec000fb8bb65b3bf45fd015fe3db (patch) | |
tree | 92e9c807e0afa5b96a04b7875f6c6f98836bd8d5 /src/frame.c | |
parent | 44d3dec071ac049a4eb4a9bb77f3945a5c116db8 (diff) | |
download | emacs-bb1513c9590fec000fb8bb65b3bf45fd015fe3db.tar.gz |
(Fmake_terminal_frame): New function.
(syms_of_frame): defsubr it.
(make_terminal_frame): Init Vframe_list only the first time.
Set visible and async_visible directly.
(redisplay): Don't display nonselected terminal frames.
Diffstat (limited to 'src/frame.c')
-rw-r--r-- | src/frame.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/src/frame.c b/src/frame.c index 56694a97b80..12eb303f110 100644 --- a/src/frame.c +++ b/src/frame.c @@ -323,24 +323,55 @@ make_minibuffer_frame () /* Construct a frame that refers to the terminal (stdin and stdout). */ +static int terminal_frame_count; + struct frame * make_terminal_frame () { register struct frame *f; Lisp_Object frame; + char name[20]; + + /* The first call must initialize Vframe_list. */ + if (! (NILP (Vframe_list) || CONSP (Vframe_list))) + Vframe_list = Qnil; - Vframe_list = Qnil; f = make_frame (1); XSETFRAME (frame, f); Vframe_list = Fcons (frame, Vframe_list); - f->name = build_string ("terminal"); - FRAME_SET_VISIBLE (f, 1); - f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ + terminal_frame_count++; + sprintf (name, "terminal-%d", terminal_frame_count); + + f->name = build_string (name); + f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ + f->async_visible = 1; /* Don't let visible be cleared later. */ + f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ XSETFRAME (Vterminal_frame, f); return f; } + +DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame, + 1, 1, 0, "") + (parms) + Lisp_Object parms; +{ + struct frame *f; + Lisp_Object frame; + + if (selected_frame->output_method != output_termcap) + error ("Not using an ASCII terminal now; cannot make a new ASCII frame"); + + f = make_terminal_frame (); + change_frame_size (f, FRAME_HEIGHT (selected_frame), + FRAME_WIDTH (selected_frame), 0, 0); + remake_frame_glyphs (f); + calculate_costs (f); + XSETFRAME (frame, f); + Fmodify_frame_parameters (frame, parms); + return frame; +} static Lisp_Object do_switch_frame (frame, no_enter, track) @@ -409,6 +440,14 @@ do_switch_frame (frame, no_enter, track) #endif /* HAVE_X_WINDOWS */ #endif /* ! 0 */ + if (FRAME_TERMCAP_P (XFRAME (frame))) + { + /* Since frames on an ASCII terminal share the same display area, + switching means we must redisplay the whole thing. */ + windows_or_buffers_changed++; + SET_FRAME_GARBAGED (XFRAME (frame)); + } + selected_frame = XFRAME (frame); if (! FRAME_MINIBUF_ONLY_P (selected_frame)) last_nonminibuf_frame = selected_frame; @@ -1810,6 +1849,7 @@ The `menu-bar-lines' element of the list controls whether new frames\n\ defsubr (&Sframep); defsubr (&Sframe_live_p); + defsubr (&Smake_terminal_frame); defsubr (&Shandle_switch_frame); defsubr (&Sselect_frame); defsubr (&Sselected_frame); |