diff options
| author | Richard M. Stallman | 1995-02-17 08:09:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-17 08:09:33 +0000 |
| commit | bb1513c9590fec000fb8bb65b3bf45fd015fe3db (patch) | |
| tree | 92e9c807e0afa5b96a04b7875f6c6f98836bd8d5 | |
| parent | 44d3dec071ac049a4eb4a9bb77f3945a5c116db8 (diff) | |
| download | emacs-bb1513c9590fec000fb8bb65b3bf45fd015fe3db.tar.gz emacs-bb1513c9590fec000fb8bb65b3bf45fd015fe3db.zip | |
(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.
| -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 () | |||
| 323 | 323 | ||
| 324 | /* Construct a frame that refers to the terminal (stdin and stdout). */ | 324 | /* Construct a frame that refers to the terminal (stdin and stdout). */ |
| 325 | 325 | ||
| 326 | static int terminal_frame_count; | ||
| 327 | |||
| 326 | struct frame * | 328 | struct frame * |
| 327 | make_terminal_frame () | 329 | make_terminal_frame () |
| 328 | { | 330 | { |
| 329 | register struct frame *f; | 331 | register struct frame *f; |
| 330 | Lisp_Object frame; | 332 | Lisp_Object frame; |
| 333 | char name[20]; | ||
| 334 | |||
| 335 | /* The first call must initialize Vframe_list. */ | ||
| 336 | if (! (NILP (Vframe_list) || CONSP (Vframe_list))) | ||
| 337 | Vframe_list = Qnil; | ||
| 331 | 338 | ||
| 332 | Vframe_list = Qnil; | ||
| 333 | f = make_frame (1); | 339 | f = make_frame (1); |
| 334 | 340 | ||
| 335 | XSETFRAME (frame, f); | 341 | XSETFRAME (frame, f); |
| 336 | Vframe_list = Fcons (frame, Vframe_list); | 342 | Vframe_list = Fcons (frame, Vframe_list); |
| 337 | 343 | ||
| 338 | f->name = build_string ("terminal"); | 344 | terminal_frame_count++; |
| 339 | FRAME_SET_VISIBLE (f, 1); | 345 | sprintf (name, "terminal-%d", terminal_frame_count); |
| 340 | f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | 346 | |
| 347 | f->name = build_string (name); | ||
| 348 | f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ | ||
| 349 | f->async_visible = 1; /* Don't let visible be cleared later. */ | ||
| 350 | f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | ||
| 341 | XSETFRAME (Vterminal_frame, f); | 351 | XSETFRAME (Vterminal_frame, f); |
| 342 | return f; | 352 | return f; |
| 343 | } | 353 | } |
| 354 | |||
| 355 | DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame, | ||
| 356 | 1, 1, 0, "") | ||
| 357 | (parms) | ||
| 358 | Lisp_Object parms; | ||
| 359 | { | ||
| 360 | struct frame *f; | ||
| 361 | Lisp_Object frame; | ||
| 362 | |||
| 363 | if (selected_frame->output_method != output_termcap) | ||
| 364 | error ("Not using an ASCII terminal now; cannot make a new ASCII frame"); | ||
| 365 | |||
| 366 | f = make_terminal_frame (); | ||
| 367 | change_frame_size (f, FRAME_HEIGHT (selected_frame), | ||
| 368 | FRAME_WIDTH (selected_frame), 0, 0); | ||
| 369 | remake_frame_glyphs (f); | ||
| 370 | calculate_costs (f); | ||
| 371 | XSETFRAME (frame, f); | ||
| 372 | Fmodify_frame_parameters (frame, parms); | ||
| 373 | return frame; | ||
| 374 | } | ||
| 344 | 375 | ||
| 345 | static Lisp_Object | 376 | static Lisp_Object |
| 346 | do_switch_frame (frame, no_enter, track) | 377 | do_switch_frame (frame, no_enter, track) |
| @@ -409,6 +440,14 @@ do_switch_frame (frame, no_enter, track) | |||
| 409 | #endif /* HAVE_X_WINDOWS */ | 440 | #endif /* HAVE_X_WINDOWS */ |
| 410 | #endif /* ! 0 */ | 441 | #endif /* ! 0 */ |
| 411 | 442 | ||
| 443 | if (FRAME_TERMCAP_P (XFRAME (frame))) | ||
| 444 | { | ||
| 445 | /* Since frames on an ASCII terminal share the same display area, | ||
| 446 | switching means we must redisplay the whole thing. */ | ||
| 447 | windows_or_buffers_changed++; | ||
| 448 | SET_FRAME_GARBAGED (XFRAME (frame)); | ||
| 449 | } | ||
| 450 | |||
| 412 | selected_frame = XFRAME (frame); | 451 | selected_frame = XFRAME (frame); |
| 413 | if (! FRAME_MINIBUF_ONLY_P (selected_frame)) | 452 | if (! FRAME_MINIBUF_ONLY_P (selected_frame)) |
| 414 | last_nonminibuf_frame = selected_frame; | 453 | last_nonminibuf_frame = selected_frame; |
| @@ -1810,6 +1849,7 @@ The `menu-bar-lines' element of the list controls whether new frames\n\ | |||
| 1810 | 1849 | ||
| 1811 | defsubr (&Sframep); | 1850 | defsubr (&Sframep); |
| 1812 | defsubr (&Sframe_live_p); | 1851 | defsubr (&Sframe_live_p); |
| 1852 | defsubr (&Smake_terminal_frame); | ||
| 1813 | defsubr (&Shandle_switch_frame); | 1853 | defsubr (&Shandle_switch_frame); |
| 1814 | defsubr (&Sselect_frame); | 1854 | defsubr (&Sselect_frame); |
| 1815 | defsubr (&Sselected_frame); | 1855 | defsubr (&Sselected_frame); |