diff options
| author | Gerd Moellmann | 1999-09-13 11:13:53 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-09-13 11:13:53 +0000 |
| commit | e52f4e084a6875a4f96f58669b3774e7bf98306b (patch) | |
| tree | 98321054d8147a8026f40a98a56642ded3affaeb | |
| parent | 2d0641146fb8cfd1cf5cf2e0004b7777775c9821 (diff) | |
| download | emacs-e52f4e084a6875a4f96f58669b3774e7bf98306b.tar.gz emacs-e52f4e084a6875a4f96f58669b3774e7bf98306b.zip | |
(OUTPUT): Change for Lisp_Object selected_frame.
(OUTPUT_IF, ring_bell, set_terminal_modes, reset_terminal_modes,
set_terminal_window, set_scroll_region, reassert_line_highlight,
change_line_highlight, cursor_to, raw_cursor_to, clear_to_end,
clear_end_of_line, clear_end_of_line_raw, clear_end_of_line_raw,
encode_terminal_code, write_glyphs, term_init): Ditto.
| -rw-r--r-- | src/term.c | 143 |
1 files changed, 79 insertions, 64 deletions
diff --git a/src/term.c b/src/term.c index 8a243317869..89c0892cb3a 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -51,14 +51,16 @@ static void tty_hide_cursor P_ ((void)); | |||
| 51 | #define max(a, b) ((a) > (b) ? (a) : (b)) | 51 | #define max(a, b) ((a) > (b) ? (a) : (b)) |
| 52 | #define min(a, b) ((a) < (b) ? (a) : (b)) | 52 | #define min(a, b) ((a) < (b) ? (a) : (b)) |
| 53 | 53 | ||
| 54 | #define OUTPUT(a) tputs (a, (int) (FRAME_HEIGHT (selected_frame) - curY), cmputc) | 54 | #define OUTPUT(a) \ |
| 55 | tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) - curY), cmputc) | ||
| 55 | #define OUTPUT1(a) tputs (a, 1, cmputc) | 56 | #define OUTPUT1(a) tputs (a, 1, cmputc) |
| 56 | #define OUTPUTL(a, lines) tputs (a, lines, cmputc) | 57 | #define OUTPUTL(a, lines) tputs (a, lines, cmputc) |
| 57 | 58 | ||
| 58 | #define OUTPUT_IF(a) \ | 59 | #define OUTPUT_IF(a) \ |
| 59 | if (a) \ | 60 | if (a) \ |
| 60 | tputs (a, (int) (FRAME_HEIGHT (selected_frame) - curY), cmputc); \ | 61 | tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) \ |
| 61 | else \ | 62 | - curY), cmputc); \ |
| 63 | else \ | ||
| 62 | (void) 0 | 64 | (void) 0 |
| 63 | 65 | ||
| 64 | #define OUTPUT1_IF(a) if (a) tputs (a, 1, cmputc); else (void) 0 | 66 | #define OUTPUT1_IF(a) if (a) tputs (a, 1, cmputc); else (void) 0 |
| @@ -419,7 +421,7 @@ ring_bell () | |||
| 419 | return; | 421 | return; |
| 420 | } | 422 | } |
| 421 | 423 | ||
| 422 | if (! FRAME_TERMCAP_P (selected_frame)) | 424 | if (! FRAME_TERMCAP_P (XFRAME (selected_frame))) |
| 423 | { | 425 | { |
| 424 | (*ring_bell_hook) (); | 426 | (*ring_bell_hook) (); |
| 425 | return; | 427 | return; |
| @@ -430,7 +432,7 @@ ring_bell () | |||
| 430 | void | 432 | void |
| 431 | set_terminal_modes () | 433 | set_terminal_modes () |
| 432 | { | 434 | { |
| 433 | if (! FRAME_TERMCAP_P (selected_frame)) | 435 | if (! FRAME_TERMCAP_P (XFRAME (selected_frame))) |
| 434 | { | 436 | { |
| 435 | (*set_terminal_modes_hook) (); | 437 | (*set_terminal_modes_hook) (); |
| 436 | return; | 438 | return; |
| @@ -444,7 +446,7 @@ set_terminal_modes () | |||
| 444 | void | 446 | void |
| 445 | reset_terminal_modes () | 447 | reset_terminal_modes () |
| 446 | { | 448 | { |
| 447 | if (! FRAME_TERMCAP_P (selected_frame)) | 449 | if (! FRAME_TERMCAP_P (XFRAME (selected_frame))) |
| 448 | { | 450 | { |
| 449 | if (reset_terminal_modes_hook) | 451 | if (reset_terminal_modes_hook) |
| 450 | (*reset_terminal_modes_hook) (); | 452 | (*reset_terminal_modes_hook) (); |
| @@ -505,7 +507,7 @@ set_terminal_window (size) | |||
| 505 | (*set_terminal_window_hook) (size); | 507 | (*set_terminal_window_hook) (size); |
| 506 | return; | 508 | return; |
| 507 | } | 509 | } |
| 508 | specified_window = size ? size : FRAME_HEIGHT (selected_frame); | 510 | specified_window = size ? size : FRAME_HEIGHT (XFRAME (selected_frame)); |
| 509 | if (!scroll_region_ok) | 511 | if (!scroll_region_ok) |
| 510 | return; | 512 | return; |
| 511 | set_scroll_region (0, specified_window); | 513 | set_scroll_region (0, specified_window); |
| @@ -516,6 +518,8 @@ set_scroll_region (start, stop) | |||
| 516 | int start, stop; | 518 | int start, stop; |
| 517 | { | 519 | { |
| 518 | char *buf; | 520 | char *buf; |
| 521 | struct frame *sf = XFRAME (selected_frame); | ||
| 522 | |||
| 519 | if (TS_set_scroll_region) | 523 | if (TS_set_scroll_region) |
| 520 | { | 524 | { |
| 521 | buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1); | 525 | buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1); |
| @@ -523,13 +527,13 @@ set_scroll_region (start, stop) | |||
| 523 | else if (TS_set_scroll_region_1) | 527 | else if (TS_set_scroll_region_1) |
| 524 | { | 528 | { |
| 525 | buf = tparam (TS_set_scroll_region_1, 0, 0, | 529 | buf = tparam (TS_set_scroll_region_1, 0, 0, |
| 526 | FRAME_HEIGHT (selected_frame), start, | 530 | FRAME_HEIGHT (sf), start, |
| 527 | FRAME_HEIGHT (selected_frame) - stop, | 531 | FRAME_HEIGHT (sf) - stop, |
| 528 | FRAME_HEIGHT (selected_frame)); | 532 | FRAME_HEIGHT (sf)); |
| 529 | } | 533 | } |
| 530 | else | 534 | else |
| 531 | { | 535 | { |
| 532 | buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_WIDTH (selected_frame)); | 536 | buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_WIDTH (sf)); |
| 533 | } | 537 | } |
| 534 | OUTPUT (buf); | 538 | OUTPUT (buf); |
| 535 | xfree (buf); | 539 | xfree (buf); |
| @@ -663,7 +667,8 @@ reassert_line_highlight (highlight, vpos) | |||
| 663 | int highlight; | 667 | int highlight; |
| 664 | int vpos; | 668 | int vpos; |
| 665 | { | 669 | { |
| 666 | if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))) | 670 | struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame); |
| 671 | if (! FRAME_TERMCAP_P (f)) | ||
| 667 | { | 672 | { |
| 668 | (*reassert_line_highlight_hook) (highlight, vpos); | 673 | (*reassert_line_highlight_hook) (highlight, vpos); |
| 669 | return; | 674 | return; |
| @@ -702,7 +707,7 @@ change_line_highlight (new_highlight, vpos, y, first_unused_hpos) | |||
| 702 | /* On Teleray, make sure to erase the SO marker. */ | 707 | /* On Teleray, make sure to erase the SO marker. */ |
| 703 | if (TF_teleray) | 708 | if (TF_teleray) |
| 704 | { | 709 | { |
| 705 | cmgoto (curY - 1, FRAME_WIDTH (selected_frame) - 4); | 710 | cmgoto (curY - 1, FRAME_WIDTH (XFRAME (selected_frame)) - 4); |
| 706 | OUTPUT ("\033S"); | 711 | OUTPUT ("\033S"); |
| 707 | curY++; /* ESC S moves to next line where the TS_standout_mode was */ | 712 | curY++; /* ESC S moves to next line where the TS_standout_mode was */ |
| 708 | curX = 0; | 713 | curX = 0; |
| @@ -722,8 +727,9 @@ void | |||
| 722 | cursor_to (vpos, hpos) | 727 | cursor_to (vpos, hpos) |
| 723 | int vpos, hpos; | 728 | int vpos, hpos; |
| 724 | { | 729 | { |
| 725 | if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)) | 730 | struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame); |
| 726 | && cursor_to_hook) | 731 | |
| 732 | if (! FRAME_TERMCAP_P (f) && cursor_to_hook) | ||
| 727 | { | 733 | { |
| 728 | (*cursor_to_hook) (vpos, hpos); | 734 | (*cursor_to_hook) (vpos, hpos); |
| 729 | return; | 735 | return; |
| @@ -750,7 +756,8 @@ void | |||
| 750 | raw_cursor_to (row, col) | 756 | raw_cursor_to (row, col) |
| 751 | int row, col; | 757 | int row, col; |
| 752 | { | 758 | { |
| 753 | if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))) | 759 | struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame); |
| 760 | if (! FRAME_TERMCAP_P (f)) | ||
| 754 | { | 761 | { |
| 755 | (*raw_cursor_to_hook) (row, col); | 762 | (*raw_cursor_to_hook) (row, col); |
| 756 | return; | 763 | return; |
| @@ -781,14 +788,15 @@ clear_to_end () | |||
| 781 | { | 788 | { |
| 782 | background_highlight (); | 789 | background_highlight (); |
| 783 | OUTPUT (TS_clr_to_bottom); | 790 | OUTPUT (TS_clr_to_bottom); |
| 784 | bzero (chars_wasted + curY, FRAME_HEIGHT (selected_frame) - curY); | 791 | bzero (chars_wasted + curY, |
| 792 | FRAME_HEIGHT (XFRAME (selected_frame)) - curY); | ||
| 785 | } | 793 | } |
| 786 | else | 794 | else |
| 787 | { | 795 | { |
| 788 | for (i = curY; i < FRAME_HEIGHT (selected_frame); i++) | 796 | for (i = curY; i < FRAME_HEIGHT (XFRAME (selected_frame)); i++) |
| 789 | { | 797 | { |
| 790 | cursor_to (i, 0); | 798 | cursor_to (i, 0); |
| 791 | clear_end_of_line_raw (FRAME_WIDTH (selected_frame)); | 799 | clear_end_of_line_raw (FRAME_WIDTH (XFRAME (selected_frame))); |
| 792 | } | 800 | } |
| 793 | } | 801 | } |
| 794 | } | 802 | } |
| @@ -798,8 +806,10 @@ clear_to_end () | |||
| 798 | void | 806 | void |
| 799 | clear_frame () | 807 | clear_frame () |
| 800 | { | 808 | { |
| 809 | struct frame *sf = XFRAME (selected_frame); | ||
| 810 | |||
| 801 | if (clear_frame_hook | 811 | if (clear_frame_hook |
| 802 | && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))) | 812 | && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : sf))) |
| 803 | { | 813 | { |
| 804 | (*clear_frame_hook) (); | 814 | (*clear_frame_hook) (); |
| 805 | return; | 815 | return; |
| @@ -808,7 +818,7 @@ clear_frame () | |||
| 808 | { | 818 | { |
| 809 | background_highlight (); | 819 | background_highlight (); |
| 810 | OUTPUT (TS_clr_frame); | 820 | OUTPUT (TS_clr_frame); |
| 811 | bzero (chars_wasted, FRAME_HEIGHT (selected_frame)); | 821 | bzero (chars_wasted, FRAME_HEIGHT (sf)); |
| 812 | cmat (0, 0); | 822 | cmat (0, 0); |
| 813 | } | 823 | } |
| 814 | else | 824 | else |
| @@ -829,7 +839,7 @@ void | |||
| 829 | clear_end_of_line (first_unused_hpos) | 839 | clear_end_of_line (first_unused_hpos) |
| 830 | int first_unused_hpos; | 840 | int first_unused_hpos; |
| 831 | { | 841 | { |
| 832 | if (FRAME_TERMCAP_P (selected_frame) | 842 | if (FRAME_TERMCAP_P (XFRAME (selected_frame)) |
| 833 | && chars_wasted != 0 | 843 | && chars_wasted != 0 |
| 834 | && TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0) | 844 | && TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0) |
| 835 | write_glyphs (&space_glyph, 1); | 845 | write_glyphs (&space_glyph, 1); |
| @@ -851,7 +861,7 @@ clear_end_of_line_raw (first_unused_hpos) | |||
| 851 | if (clear_end_of_line_hook | 861 | if (clear_end_of_line_hook |
| 852 | && ! FRAME_TERMCAP_P ((updating_frame | 862 | && ! FRAME_TERMCAP_P ((updating_frame |
| 853 | ? updating_frame | 863 | ? updating_frame |
| 854 | : selected_frame))) | 864 | : XFRAME (selected_frame)))) |
| 855 | { | 865 | { |
| 856 | (*clear_end_of_line_hook) (first_unused_hpos); | 866 | (*clear_end_of_line_hook) (first_unused_hpos); |
| 857 | return; | 867 | return; |
| @@ -875,11 +885,12 @@ clear_end_of_line_raw (first_unused_hpos) | |||
| 875 | } | 885 | } |
| 876 | else | 886 | else |
| 877 | { /* have to do it the hard way */ | 887 | { /* have to do it the hard way */ |
| 888 | struct frame *sf = XFRAME (selected_frame); | ||
| 878 | turn_off_insert (); | 889 | turn_off_insert (); |
| 879 | 890 | ||
| 880 | /* Do not write in last row last col with Auto-wrap on. */ | 891 | /* Do not write in last row last col with Auto-wrap on. */ |
| 881 | if (AutoWrap && curY == FRAME_HEIGHT (selected_frame) - 1 | 892 | if (AutoWrap && curY == FRAME_HEIGHT (sf) - 1 |
| 882 | && first_unused_hpos == FRAME_WIDTH (selected_frame)) | 893 | && first_unused_hpos == FRAME_WIDTH (sf)) |
| 883 | first_unused_hpos--; | 894 | first_unused_hpos--; |
| 884 | 895 | ||
| 885 | for (i = curX; i < first_unused_hpos; i++) | 896 | for (i = curX; i < first_unused_hpos; i++) |
| @@ -929,26 +940,27 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed) | |||
| 929 | /* We must skip glyphs to be padded for a wide character. */ | 940 | /* We must skip glyphs to be padded for a wide character. */ |
| 930 | if (! CHAR_GLYPH_PADDING_P (*src)) | 941 | if (! CHAR_GLYPH_PADDING_P (*src)) |
| 931 | { | 942 | { |
| 943 | struct frame *sf = XFRAME (selected_frame); | ||
| 944 | |||
| 932 | c = src->u.ch.code; | 945 | c = src->u.ch.code; |
| 933 | if (! GLYPH_CHAR_VALID_P (c)) | 946 | if (! GLYPH_CHAR_VALID_P (c)) |
| 934 | { | 947 | { |
| 935 | c = ' '; | 948 | c = ' '; |
| 936 | g = MAKE_GLYPH (selected_frame, c, | 949 | g = MAKE_GLYPH (sf, c, GLYPH_FACE (sf, g)); |
| 937 | GLYPH_FACE (selected_frame, g)); | ||
| 938 | } | 950 | } |
| 939 | if (COMPOSITE_CHAR_P (c)) | 951 | if (COMPOSITE_CHAR_P (c)) |
| 940 | { | 952 | { |
| 941 | /* If C is a composite character, we can display | 953 | /* If C is a composite character, we can display |
| 942 | only the first component. */ | 954 | only the first component. */ |
| 943 | g = cmpchar_table[COMPOSITE_CHAR_ID (c)]->glyph[0], | 955 | g = cmpchar_table[COMPOSITE_CHAR_ID (c)]->glyph[0], |
| 944 | c = GLYPH_CHAR (selected_frame, g); | 956 | c = GLYPH_CHAR (sf, g); |
| 945 | } | 957 | } |
| 946 | if (c < tlen) | 958 | if (c < tlen) |
| 947 | { | 959 | { |
| 948 | /* G has an entry in Vglyph_table, | 960 | /* G has an entry in Vglyph_table, |
| 949 | so process any alias before testing for simpleness. */ | 961 | so process any alias before testing for simpleness. */ |
| 950 | GLYPH_FOLLOW_ALIASES (tbase, tlen, g); | 962 | GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
| 951 | c = GLYPH_CHAR (selected_frame, g); | 963 | c = GLYPH_CHAR (sf, g); |
| 952 | } | 964 | } |
| 953 | if (GLYPH_SIMPLE_P (tbase, tlen, g)) | 965 | if (GLYPH_SIMPLE_P (tbase, tlen, g)) |
| 954 | /* We set the multi-byte form of C at BUF. */ | 966 | /* We set the multi-byte form of C at BUF. */ |
| @@ -994,7 +1006,8 @@ write_glyphs (string, len) | |||
| 994 | register int len; | 1006 | register int len; |
| 995 | { | 1007 | { |
| 996 | int produced, consumed; | 1008 | int produced, consumed; |
| 997 | struct frame *f = updating_frame ? updating_frame : selected_frame; | 1009 | struct frame *sf = XFRAME (selected_frame); |
| 1010 | struct frame *f = updating_frame ? updating_frame : sf; | ||
| 998 | 1011 | ||
| 999 | if (write_glyphs_hook | 1012 | if (write_glyphs_hook |
| 1000 | && ! FRAME_TERMCAP_P (f)) | 1013 | && ! FRAME_TERMCAP_P (f)) |
| @@ -1010,9 +1023,8 @@ write_glyphs (string, len) | |||
| 1010 | since that would scroll the whole frame on some terminals. */ | 1023 | since that would scroll the whole frame on some terminals. */ |
| 1011 | 1024 | ||
| 1012 | if (AutoWrap | 1025 | if (AutoWrap |
| 1013 | && curY + 1 == FRAME_HEIGHT (selected_frame) | 1026 | && curY + 1 == FRAME_HEIGHT (sf) |
| 1014 | && (curX + len - (chars_wasted[curY] & 077) | 1027 | && (curX + len - (chars_wasted[curY] & 077) == FRAME_WIDTH (sf))) |
| 1015 | == FRAME_WIDTH (selected_frame))) | ||
| 1016 | len --; | 1028 | len --; |
| 1017 | if (len <= 0) | 1029 | if (len <= 0) |
| 1018 | return; | 1030 | return; |
| @@ -1090,7 +1102,7 @@ insert_glyphs (start, len) | |||
| 1090 | { | 1102 | { |
| 1091 | char *buf; | 1103 | char *buf; |
| 1092 | GLYPH g; | 1104 | GLYPH g; |
| 1093 | struct frame *f; | 1105 | struct frame *f, *sf; |
| 1094 | 1106 | ||
| 1095 | if (len <= 0) | 1107 | if (len <= 0) |
| 1096 | return; | 1108 | return; |
| @@ -1101,7 +1113,8 @@ insert_glyphs (start, len) | |||
| 1101 | return; | 1113 | return; |
| 1102 | } | 1114 | } |
| 1103 | 1115 | ||
| 1104 | f = updating_frame ? updating_frame : selected_frame; | 1116 | sf = XFRAME (selected_frame); |
| 1117 | f = updating_frame ? updating_frame : sf; | ||
| 1105 | highlight_if_desired (); | 1118 | highlight_if_desired (); |
| 1106 | 1119 | ||
| 1107 | if (TS_ins_multi_chars) | 1120 | if (TS_ins_multi_chars) |
| @@ -1210,6 +1223,7 @@ ins_del_lines (vpos, n) | |||
| 1210 | char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines; | 1223 | char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines; |
| 1211 | char *single = n > 0 ? TS_ins_line : TS_del_line; | 1224 | char *single = n > 0 ? TS_ins_line : TS_del_line; |
| 1212 | char *scroll = n > 0 ? TS_rev_scroll : TS_fwd_scroll; | 1225 | char *scroll = n > 0 ? TS_rev_scroll : TS_fwd_scroll; |
| 1226 | struct frame *sf; | ||
| 1213 | 1227 | ||
| 1214 | register int i = n > 0 ? n : -n; | 1228 | register int i = n > 0 ? n : -n; |
| 1215 | register char *buf; | 1229 | register char *buf; |
| @@ -1220,6 +1234,8 @@ ins_del_lines (vpos, n) | |||
| 1220 | return; | 1234 | return; |
| 1221 | } | 1235 | } |
| 1222 | 1236 | ||
| 1237 | sf = XFRAME (selected_frame); | ||
| 1238 | |||
| 1223 | /* If the lines below the insertion are being pushed | 1239 | /* If the lines below the insertion are being pushed |
| 1224 | into the end of the window, this is the same as clearing; | 1240 | into the end of the window, this is the same as clearing; |
| 1225 | and we know the lines are already clear, since the matching | 1241 | and we know the lines are already clear, since the matching |
| @@ -1229,7 +1245,7 @@ ins_del_lines (vpos, n) | |||
| 1229 | as there will be a matching inslines later that will flush them. */ | 1245 | as there will be a matching inslines later that will flush them. */ |
| 1230 | if (scroll_region_ok && vpos + i >= specified_window) | 1246 | if (scroll_region_ok && vpos + i >= specified_window) |
| 1231 | return; | 1247 | return; |
| 1232 | if (!memory_below_frame && vpos + i >= FRAME_HEIGHT (selected_frame)) | 1248 | if (!memory_below_frame && vpos + i >= FRAME_HEIGHT (sf)) |
| 1233 | return; | 1249 | return; |
| 1234 | 1250 | ||
| 1235 | if (multi) | 1251 | if (multi) |
| @@ -1267,7 +1283,7 @@ ins_del_lines (vpos, n) | |||
| 1267 | register int lower_limit | 1283 | register int lower_limit |
| 1268 | = (scroll_region_ok | 1284 | = (scroll_region_ok |
| 1269 | ? specified_window | 1285 | ? specified_window |
| 1270 | : FRAME_HEIGHT (selected_frame)); | 1286 | : FRAME_HEIGHT (sf)); |
| 1271 | 1287 | ||
| 1272 | if (n < 0) | 1288 | if (n < 0) |
| 1273 | { | 1289 | { |
| @@ -1285,7 +1301,7 @@ ins_del_lines (vpos, n) | |||
| 1285 | } | 1301 | } |
| 1286 | if (!scroll_region_ok && memory_below_frame && n < 0) | 1302 | if (!scroll_region_ok && memory_below_frame && n < 0) |
| 1287 | { | 1303 | { |
| 1288 | cursor_to (FRAME_HEIGHT (selected_frame) + n, 0); | 1304 | cursor_to (FRAME_HEIGHT (sf) + n, 0); |
| 1289 | clear_to_end (); | 1305 | clear_to_end (); |
| 1290 | } | 1306 | } |
| 1291 | } | 1307 | } |
| @@ -2046,6 +2062,7 @@ term_init (terminal_type) | |||
| 2046 | char buffer[2044]; | 2062 | char buffer[2044]; |
| 2047 | register char *p; | 2063 | register char *p; |
| 2048 | int status; | 2064 | int status; |
| 2065 | struct frame *sf = XFRAME (selected_frame); | ||
| 2049 | 2066 | ||
| 2050 | #ifdef WINDOWSNT | 2067 | #ifdef WINDOWSNT |
| 2051 | initialize_w32_display (); | 2068 | initialize_w32_display (); |
| @@ -2057,9 +2074,9 @@ term_init (terminal_type) | |||
| 2057 | if (area == 0) | 2074 | if (area == 0) |
| 2058 | abort (); | 2075 | abort (); |
| 2059 | 2076 | ||
| 2060 | FrameRows = FRAME_HEIGHT (selected_frame); | 2077 | FrameRows = FRAME_HEIGHT (sf); |
| 2061 | FrameCols = FRAME_WIDTH (selected_frame); | 2078 | FrameCols = FRAME_WIDTH (sf); |
| 2062 | specified_window = FRAME_HEIGHT (selected_frame); | 2079 | specified_window = FRAME_HEIGHT (sf); |
| 2063 | 2080 | ||
| 2064 | delete_in_insert_mode = 1; | 2081 | delete_in_insert_mode = 1; |
| 2065 | 2082 | ||
| @@ -2076,8 +2093,8 @@ term_init (terminal_type) | |||
| 2076 | 2093 | ||
| 2077 | baud_rate = 19200; | 2094 | baud_rate = 19200; |
| 2078 | 2095 | ||
| 2079 | FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0; | 2096 | FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0; |
| 2080 | FRAME_VERTICAL_SCROLL_BAR_TYPE (selected_frame) = vertical_scroll_bar_none; | 2097 | FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none; |
| 2081 | 2098 | ||
| 2082 | return; | 2099 | return; |
| 2083 | #else /* not WINDOWSNT */ | 2100 | #else /* not WINDOWSNT */ |
| @@ -2228,22 +2245,21 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2228 | { | 2245 | { |
| 2229 | int height, width; | 2246 | int height, width; |
| 2230 | get_frame_size (&width, &height); | 2247 | get_frame_size (&width, &height); |
| 2231 | FRAME_WIDTH (selected_frame) = width; | 2248 | FRAME_WIDTH (sf) = width; |
| 2232 | FRAME_HEIGHT (selected_frame) = height; | 2249 | FRAME_HEIGHT (sf) = height; |
| 2233 | } | 2250 | } |
| 2234 | 2251 | ||
| 2235 | if (FRAME_WIDTH (selected_frame) <= 0) | 2252 | if (FRAME_WIDTH (sf) <= 0) |
| 2236 | SET_FRAME_WIDTH (selected_frame, tgetnum ("co")); | 2253 | SET_FRAME_WIDTH (sf, tgetnum ("co")); |
| 2237 | else | 2254 | else |
| 2238 | /* Keep width and external_width consistent */ | 2255 | /* Keep width and external_width consistent */ |
| 2239 | SET_FRAME_WIDTH (selected_frame, FRAME_WIDTH (selected_frame)); | 2256 | SET_FRAME_WIDTH (sf, FRAME_WIDTH (sf)); |
| 2240 | if (FRAME_HEIGHT (selected_frame) <= 0) | 2257 | if (FRAME_HEIGHT (sf) <= 0) |
| 2241 | FRAME_HEIGHT (selected_frame) = tgetnum ("li"); | 2258 | FRAME_HEIGHT (sf) = tgetnum ("li"); |
| 2242 | 2259 | ||
| 2243 | if (FRAME_HEIGHT (selected_frame) < 3 | 2260 | if (FRAME_HEIGHT (sf) < 3 || FRAME_WIDTH (sf) < 3) |
| 2244 | || FRAME_WIDTH (selected_frame) < 3) | ||
| 2245 | fatal ("Screen size %dx%d is too small", | 2261 | fatal ("Screen size %dx%d is too small", |
| 2246 | FRAME_HEIGHT (selected_frame), FRAME_WIDTH (selected_frame)); | 2262 | FRAME_HEIGHT (sf), FRAME_WIDTH (sf)); |
| 2247 | 2263 | ||
| 2248 | min_padding_speed = tgetnum ("pb"); | 2264 | min_padding_speed = tgetnum ("pb"); |
| 2249 | TN_standout_width = tgetnum ("sg"); | 2265 | TN_standout_width = tgetnum ("sg"); |
| @@ -2356,9 +2372,9 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2356 | } | 2372 | } |
| 2357 | } | 2373 | } |
| 2358 | 2374 | ||
| 2359 | FrameRows = FRAME_HEIGHT (selected_frame); | 2375 | FrameRows = FRAME_HEIGHT (sf); |
| 2360 | FrameCols = FRAME_WIDTH (selected_frame); | 2376 | FrameCols = FRAME_WIDTH (sf); |
| 2361 | specified_window = FRAME_HEIGHT (selected_frame); | 2377 | specified_window = FRAME_HEIGHT (sf); |
| 2362 | 2378 | ||
| 2363 | if (Wcm_init () == -1) /* can't do cursor motion */ | 2379 | if (Wcm_init () == -1) /* can't do cursor motion */ |
| 2364 | #ifdef VMS | 2380 | #ifdef VMS |
| @@ -2387,8 +2403,8 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2387 | terminal_type); | 2403 | terminal_type); |
| 2388 | # endif /* TERMINFO */ | 2404 | # endif /* TERMINFO */ |
| 2389 | #endif /*VMS */ | 2405 | #endif /*VMS */ |
| 2390 | if (FRAME_HEIGHT (selected_frame) <= 0 | 2406 | if (FRAME_HEIGHT (sf) <= 0 |
| 2391 | || FRAME_WIDTH (selected_frame) <= 0) | 2407 | || FRAME_WIDTH (sf) <= 0) |
| 2392 | fatal ("The frame size has not been specified"); | 2408 | fatal ("The frame size has not been specified"); |
| 2393 | 2409 | ||
| 2394 | delete_in_insert_mode | 2410 | delete_in_insert_mode |
| @@ -2401,8 +2417,7 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2401 | 2417 | ||
| 2402 | /* Remove width of standout marker from usable width of line */ | 2418 | /* Remove width of standout marker from usable width of line */ |
| 2403 | if (TN_standout_width > 0) | 2419 | if (TN_standout_width > 0) |
| 2404 | SET_FRAME_WIDTH (selected_frame, | 2420 | SET_FRAME_WIDTH (sf, FRAME_WIDTH (sf) - TN_standout_width); |
| 2405 | FRAME_WIDTH (selected_frame) - TN_standout_width); | ||
| 2406 | 2421 | ||
| 2407 | UseTabs = tabs_safe_p () && TabWidth == 8; | 2422 | UseTabs = tabs_safe_p () && TabWidth == 8; |
| 2408 | 2423 | ||
| @@ -2425,8 +2440,8 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2425 | /* meaningless in this case */ | 2440 | /* meaningless in this case */ |
| 2426 | baud_rate = 9600; | 2441 | baud_rate = 9600; |
| 2427 | 2442 | ||
| 2428 | FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0; | 2443 | FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0; |
| 2429 | FRAME_VERTICAL_SCROLL_BAR_TYPE (selected_frame) = vertical_scroll_bar_none; | 2444 | FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none; |
| 2430 | #endif /* WINDOWSNT */ | 2445 | #endif /* WINDOWSNT */ |
| 2431 | } | 2446 | } |
| 2432 | 2447 | ||