diff options
| author | Karoly Lorentey | 2003-12-25 07:29:18 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2003-12-25 07:29:18 +0000 |
| commit | ed02974bb250f20d339f25a2085f19e45f1969c7 (patch) | |
| tree | 15c915944f5a5cc2f9932f2d066d33c4c2ef44f4 /src | |
| parent | 28d440abfe46139dff7278a444e0a35896038ff8 (diff) | |
| download | emacs-ed02974bb250f20d339f25a2085f19e45f1969c7.tar.gz emacs-ed02974bb250f20d339f25a2085f19e45f1969c7.zip | |
Updating_frame vs. selected_frame in term.c.
* src/term.c (clear_end_of_line): Use updating_frame instead of selected_frame.
(set_scroll_region, clear_to_end, clear_frame, tty_show_cursor): Ditto.
(tty_hide_cursor, turn_on_highlight, turn_off_highlight): Ditto.
(turn_on_insert, turn_off_insert): Ditto.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-3
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 85 |
1 files changed, 57 insertions, 28 deletions
diff --git a/src/term.c b/src/term.c index 5739cd0d19a..4ecca5770a9 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -511,19 +511,21 @@ set_scroll_region (start, stop) | |||
| 511 | int start, stop; | 511 | int start, stop; |
| 512 | { | 512 | { |
| 513 | char *buf; | 513 | char *buf; |
| 514 | struct frame *sf = XFRAME (selected_frame); | 514 | struct frame *f = (updating_frame |
| 515 | ? updating_frame | ||
| 516 | : XFRAME (selected_frame)); | ||
| 515 | 517 | ||
| 516 | if (TS_set_scroll_region) | 518 | if (TS_set_scroll_region) |
| 517 | buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1); | 519 | buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1); |
| 518 | else if (TS_set_scroll_region_1) | 520 | else if (TS_set_scroll_region_1) |
| 519 | buf = tparam (TS_set_scroll_region_1, 0, 0, | 521 | buf = tparam (TS_set_scroll_region_1, 0, 0, |
| 520 | FRAME_LINES (sf), start, | 522 | FRAME_LINES (f), start, |
| 521 | FRAME_LINES (sf) - stop, | 523 | FRAME_LINES (f) - stop, |
| 522 | FRAME_LINES (sf)); | 524 | FRAME_LINES (f)); |
| 523 | else | 525 | else |
| 524 | buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (sf)); | 526 | buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f)); |
| 525 | 527 | ||
| 526 | OUTPUT (CURTTY (), buf); | 528 | OUTPUT (FRAME_TTY (f), buf); |
| 527 | xfree (buf); | 529 | xfree (buf); |
| 528 | losecursor (); | 530 | losecursor (); |
| 529 | } | 531 | } |
| @@ -532,16 +534,22 @@ set_scroll_region (start, stop) | |||
| 532 | static void | 534 | static void |
| 533 | turn_on_insert () | 535 | turn_on_insert () |
| 534 | { | 536 | { |
| 537 | struct frame *f = (updating_frame | ||
| 538 | ? updating_frame | ||
| 539 | : XFRAME (selected_frame)); | ||
| 535 | if (!insert_mode) | 540 | if (!insert_mode) |
| 536 | OUTPUT (CURTTY (), TS_insert_mode); | 541 | OUTPUT (FRAME_TTY (f), TS_insert_mode); |
| 537 | insert_mode = 1; | 542 | insert_mode = 1; |
| 538 | } | 543 | } |
| 539 | 544 | ||
| 540 | void | 545 | void |
| 541 | turn_off_insert () | 546 | turn_off_insert () |
| 542 | { | 547 | { |
| 548 | struct frame *f = (updating_frame | ||
| 549 | ? updating_frame | ||
| 550 | : XFRAME (selected_frame)); | ||
| 543 | if (insert_mode) | 551 | if (insert_mode) |
| 544 | OUTPUT (CURTTY (), TS_end_insert_mode); | 552 | OUTPUT (FRAME_TTY (f), TS_end_insert_mode); |
| 545 | insert_mode = 0; | 553 | insert_mode = 0; |
| 546 | } | 554 | } |
| 547 | 555 | ||
| @@ -550,16 +558,22 @@ turn_off_insert () | |||
| 550 | void | 558 | void |
| 551 | turn_off_highlight () | 559 | turn_off_highlight () |
| 552 | { | 560 | { |
| 561 | struct frame *f = (updating_frame | ||
| 562 | ? updating_frame | ||
| 563 | : XFRAME (selected_frame)); | ||
| 553 | if (standout_mode) | 564 | if (standout_mode) |
| 554 | OUTPUT_IF (CURTTY (), TS_end_standout_mode); | 565 | OUTPUT_IF (FRAME_TTY (f), TS_end_standout_mode); |
| 555 | standout_mode = 0; | 566 | standout_mode = 0; |
| 556 | } | 567 | } |
| 557 | 568 | ||
| 558 | static void | 569 | static void |
| 559 | turn_on_highlight () | 570 | turn_on_highlight () |
| 560 | { | 571 | { |
| 572 | struct frame *f = (updating_frame | ||
| 573 | ? updating_frame | ||
| 574 | : XFRAME (selected_frame)); | ||
| 561 | if (!standout_mode) | 575 | if (!standout_mode) |
| 562 | OUTPUT_IF (CURTTY(), TS_standout_mode); | 576 | OUTPUT_IF (FRAME_TTY (f), TS_standout_mode); |
| 563 | standout_mode = 1; | 577 | standout_mode = 1; |
| 564 | } | 578 | } |
| 565 | 579 | ||
| @@ -578,10 +592,14 @@ toggle_highlight () | |||
| 578 | static void | 592 | static void |
| 579 | tty_hide_cursor () | 593 | tty_hide_cursor () |
| 580 | { | 594 | { |
| 595 | struct frame *f = (updating_frame | ||
| 596 | ? updating_frame | ||
| 597 | : XFRAME (selected_frame)); | ||
| 598 | |||
| 581 | if (tty_cursor_hidden == 0) | 599 | if (tty_cursor_hidden == 0) |
| 582 | { | 600 | { |
| 583 | tty_cursor_hidden = 1; | 601 | tty_cursor_hidden = 1; |
| 584 | OUTPUT_IF (CURTTY (), TS_cursor_invisible); | 602 | OUTPUT_IF (FRAME_TTY (f), TS_cursor_invisible); |
| 585 | } | 603 | } |
| 586 | } | 604 | } |
| 587 | 605 | ||
| @@ -591,11 +609,15 @@ tty_hide_cursor () | |||
| 591 | static void | 609 | static void |
| 592 | tty_show_cursor () | 610 | tty_show_cursor () |
| 593 | { | 611 | { |
| 612 | struct frame *f = (updating_frame | ||
| 613 | ? updating_frame | ||
| 614 | : XFRAME (selected_frame)); | ||
| 615 | |||
| 594 | if (tty_cursor_hidden) | 616 | if (tty_cursor_hidden) |
| 595 | { | 617 | { |
| 596 | tty_cursor_hidden = 0; | 618 | tty_cursor_hidden = 0; |
| 597 | OUTPUT_IF (CURTTY (), TS_cursor_normal); | 619 | OUTPUT_IF (FRAME_TTY (f), TS_cursor_normal); |
| 598 | OUTPUT_IF (CURTTY (), TS_cursor_visible); | 620 | OUTPUT_IF (FRAME_TTY (f), TS_cursor_visible); |
| 599 | } | 621 | } |
| 600 | } | 622 | } |
| 601 | 623 | ||
| @@ -683,7 +705,11 @@ clear_to_end () | |||
| 683 | { | 705 | { |
| 684 | register int i; | 706 | register int i; |
| 685 | 707 | ||
| 686 | if (clear_to_end_hook && ! FRAME_TERMCAP_P (updating_frame)) | 708 | struct frame *f = (updating_frame |
| 709 | ? updating_frame | ||
| 710 | : XFRAME (selected_frame)); | ||
| 711 | |||
| 712 | if (clear_to_end_hook && ! FRAME_TERMCAP_P (f)) | ||
| 687 | { | 713 | { |
| 688 | (*clear_to_end_hook) (); | 714 | (*clear_to_end_hook) (); |
| 689 | return; | 715 | return; |
| @@ -691,14 +717,14 @@ clear_to_end () | |||
| 691 | if (TS_clr_to_bottom) | 717 | if (TS_clr_to_bottom) |
| 692 | { | 718 | { |
| 693 | background_highlight (); | 719 | background_highlight (); |
| 694 | OUTPUT (CURTTY (), TS_clr_to_bottom); | 720 | OUTPUT (FRAME_TTY (f), TS_clr_to_bottom); |
| 695 | } | 721 | } |
| 696 | else | 722 | else |
| 697 | { | 723 | { |
| 698 | for (i = curY; i < FRAME_LINES (XFRAME (selected_frame)); i++) | 724 | for (i = curY; i < FRAME_LINES (f); i++) |
| 699 | { | 725 | { |
| 700 | cursor_to (i, 0); | 726 | cursor_to (i, 0); |
| 701 | clear_end_of_line (FRAME_COLS (XFRAME (selected_frame))); | 727 | clear_end_of_line (FRAME_COLS (f)); |
| 702 | } | 728 | } |
| 703 | } | 729 | } |
| 704 | } | 730 | } |
| @@ -708,10 +734,11 @@ clear_to_end () | |||
| 708 | void | 734 | void |
| 709 | clear_frame () | 735 | clear_frame () |
| 710 | { | 736 | { |
| 711 | struct frame *sf = XFRAME (selected_frame); | 737 | struct frame *f = (updating_frame |
| 738 | ? updating_frame | ||
| 739 | : XFRAME (selected_frame)); | ||
| 712 | 740 | ||
| 713 | if (clear_frame_hook | 741 | if (clear_frame_hook && ! FRAME_TERMCAP_P (f)) |
| 714 | && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : sf))) | ||
| 715 | { | 742 | { |
| 716 | (*clear_frame_hook) (); | 743 | (*clear_frame_hook) (); |
| 717 | return; | 744 | return; |
| @@ -719,7 +746,7 @@ clear_frame () | |||
| 719 | if (TS_clr_frame) | 746 | if (TS_clr_frame) |
| 720 | { | 747 | { |
| 721 | background_highlight (); | 748 | background_highlight (); |
| 722 | OUTPUT (FRAME_TTY (updating_frame ? updating_frame : sf), TS_clr_frame); | 749 | OUTPUT (FRAME_TTY (f), TS_clr_frame); |
| 723 | cmat (0, 0); | 750 | cmat (0, 0); |
| 724 | } | 751 | } |
| 725 | else | 752 | else |
| @@ -740,10 +767,12 @@ clear_end_of_line (first_unused_hpos) | |||
| 740 | { | 767 | { |
| 741 | register int i; | 768 | register int i; |
| 742 | 769 | ||
| 770 | struct frame *f = (updating_frame | ||
| 771 | ? updating_frame | ||
| 772 | : XFRAME (selected_frame)); | ||
| 773 | |||
| 743 | if (clear_end_of_line_hook | 774 | if (clear_end_of_line_hook |
| 744 | && ! FRAME_TERMCAP_P ((updating_frame | 775 | && ! FRAME_TERMCAP_P (f)) |
| 745 | ? updating_frame | ||
| 746 | : XFRAME (selected_frame)))) | ||
| 747 | { | 776 | { |
| 748 | (*clear_end_of_line_hook) (first_unused_hpos); | 777 | (*clear_end_of_line_hook) (first_unused_hpos); |
| 749 | return; | 778 | return; |
| @@ -759,7 +788,7 @@ clear_end_of_line (first_unused_hpos) | |||
| 759 | background_highlight (); | 788 | background_highlight (); |
| 760 | if (TS_clr_line) | 789 | if (TS_clr_line) |
| 761 | { | 790 | { |
| 762 | OUTPUT1 (CURTTY (), TS_clr_line); | 791 | OUTPUT1 (FRAME_TTY (f), TS_clr_line); |
| 763 | } | 792 | } |
| 764 | else | 793 | else |
| 765 | { /* have to do it the hard way */ | 794 | { /* have to do it the hard way */ |
| @@ -773,9 +802,9 @@ clear_end_of_line (first_unused_hpos) | |||
| 773 | 802 | ||
| 774 | for (i = curX; i < first_unused_hpos; i++) | 803 | for (i = curX; i < first_unused_hpos; i++) |
| 775 | { | 804 | { |
| 776 | if (TTY_TERMSCRIPT (CURTTY ())) | 805 | if (TTY_TERMSCRIPT (FRAME_TTY (f))) |
| 777 | fputc (' ', TTY_TERMSCRIPT (CURTTY ())); | 806 | fputc (' ', TTY_TERMSCRIPT (FRAME_TTY (f))); |
| 778 | fputc (' ', TTY_OUTPUT (CURTTY ())); | 807 | fputc (' ', TTY_OUTPUT (FRAME_TTY (f))); |
| 779 | } | 808 | } |
| 780 | cmplus (first_unused_hpos - curX); | 809 | cmplus (first_unused_hpos - curX); |
| 781 | } | 810 | } |