aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2003-12-28 22:28:52 +0000
committerKaroly Lorentey2003-12-28 22:28:52 +0000
commit04c3243c2a25812c6d0a324d29b8fd1d5acaa715 (patch)
treefa237cda8cf320b2cbcc9eedccaaf60eb9d5acb5 /src
parent8ed48c277afad174675b3d6dcb8e7b00a4bcc97d (diff)
downloademacs-04c3243c2a25812c6d0a324d29b8fd1d5acaa715.tar.gz
emacs-04c3243c2a25812c6d0a324d29b8fd1d5acaa715.zip
Trivial changes
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-18
Diffstat (limited to 'src')
-rw-r--r--src/cm.c3
-rw-r--r--src/cm.h6
-rw-r--r--src/term.c59
3 files changed, 35 insertions, 33 deletions
diff --git a/src/cm.c b/src/cm.c
index d1deb12f690..95aa6afdcd6 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -134,8 +134,7 @@ addcol (tty, n) {
134 * after we reach the last column; this takes us to a known state. 134 * after we reach the last column; this takes us to a known state.
135 */ 135 */
136void 136void
137cmcheckmagic (tty) 137cmcheckmagic (struct tty_output *tty)
138 struct tty_output *tty;
139{ 138{
140 if (curX (tty) == FrameCols (tty)) 139 if (curX (tty) == FrameCols (tty))
141 { 140 {
diff --git a/src/cm.h b/src/cm.h
index de78ed2ef88..e71859c1a64 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -166,10 +166,10 @@ extern int evalcost ();
166extern struct tty_output *current_tty; 166extern struct tty_output *current_tty;
167extern void cmcheckmagic P_ ((struct tty_output *)); 167extern void cmcheckmagic P_ ((struct tty_output *));
168extern int cmputc P_ ((int)); 168extern int cmputc P_ ((int));
169extern void cmcostinit P_ ((struct tty_output *tty)); 169extern void cmcostinit P_ ((struct tty_output *));
170extern void cmgoto P_ ((struct tty_output *, int, int)); 170extern void cmgoto P_ ((struct tty_output *, int, int));
171extern void Wcm_clear P_ ((struct tty_output *tty)); 171extern void Wcm_clear P_ ((struct tty_output *));
172extern int Wcm_init P_ ((struct tty_output *tty)); 172extern int Wcm_init P_ ((struct tty_output *));
173 173
174/* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b 174/* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
175 (do not change this comment) */ 175 (do not change this comment) */
diff --git a/src/term.c b/src/term.c
index 53171e92369..63b198bbf2a 100644
--- a/src/term.c
+++ b/src/term.c
@@ -917,18 +917,19 @@ insert_glyphs (start, len)
917{ 917{
918 char *buf; 918 char *buf;
919 struct glyph *glyph = NULL; 919 struct glyph *glyph = NULL;
920 struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); 920 struct frame *f;
921 struct tty_output *tty; 921 struct tty_output *tty;
922 922
923 if (len <= 0) 923 if (len <= 0)
924 return; 924 return;
925 925
926 if (insert_glyphs_hook && ! FRAME_TERMCAP_P (f)) 926 if (insert_glyphs_hook)
927 { 927 {
928 (*insert_glyphs_hook) (start, len); 928 (*insert_glyphs_hook) (start, len);
929 return; 929 return;
930 } 930 }
931 931
932 f = (updating_frame ? updating_frame : XFRAME (selected_frame));
932 tty = FRAME_TTY (f); 933 tty = FRAME_TTY (f);
933 934
934 if (tty->TS_ins_multi_chars) 935 if (tty->TS_ins_multi_chars)
@@ -2156,11 +2157,9 @@ term_init (name, terminal_type)
2156 tty_list = tty; 2157 tty_list = tty;
2157 } 2158 }
2158 2159
2159 if (tty->Wcm) 2160 if (! tty->Wcm)
2160 Wcm_clear (tty); 2161 tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
2161 else 2162
2162 tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
2163
2164 if (name) 2163 if (name)
2165 { 2164 {
2166 int fd; 2165 int fd;
@@ -2676,24 +2675,6 @@ delete_tty (struct tty_output *tty)
2676{ 2675{
2677 Lisp_Object tail, frame; 2676 Lisp_Object tail, frame;
2678 2677
2679 FOR_EACH_FRAME (tail, frame)
2680 {
2681 struct frame *f = XFRAME (frame);
2682 if (FRAME_LIVE_P (f) && FRAME_TTY (f) == tty)
2683 {
2684 Fdelete_frame (frame, Qt);
2685 f->output_data.tty = 0;
2686 }
2687 }
2688
2689 /* Close the terminal and free memory. */
2690 delete_tty_1 (tty);
2691}
2692
2693static void
2694delete_tty_1 (struct tty_output *tty)
2695{
2696
2697 if (tty == tty_list) 2678 if (tty == tty_list)
2698 tty_list = tty->next; 2679 tty_list = tty->next;
2699 else 2680 else
@@ -2709,13 +2690,25 @@ delete_tty_1 (struct tty_output *tty)
2709 p->next = p->next->next; 2690 p->next = p->next->next;
2710 } 2691 }
2711 2692
2693 FOR_EACH_FRAME (tail, frame)
2694 {
2695 struct frame *f = XFRAME (frame);
2696 if (FRAME_LIVE_P (f) && FRAME_TTY (f) == tty)
2697 {
2698 Fdelete_frame (frame, Qt);
2699 f->output_data.tty = 0;
2700 }
2701 }
2702
2712 /* This hangs. */ 2703 /* This hangs. */
2713 /* reset_sys_modes (tty); */ 2704 /*
2705 reset_sys_modes (tty);
2714 2706
2715 if (tty->name) 2707 if (tty->name)
2716 xfree (tty->name); 2708 xfree (tty->name);
2717 if (tty->type) 2709 if (tty->type)
2718 xfree (tty->type); 2710 xfree (tty->type);
2711 */
2719 if (tty->input) 2712 if (tty->input)
2720 fclose (tty->input); 2713 fclose (tty->input);
2721 if (tty->output) 2714 if (tty->output)
@@ -2723,9 +2716,19 @@ delete_tty_1 (struct tty_output *tty)
2723 if (tty->termscript) 2716 if (tty->termscript)
2724 fclose (tty->termscript); 2717 fclose (tty->termscript);
2725 2718
2719 tty->input = 0;
2720 tty->output = 0;
2721 tty->termscript = 0;
2722
2726 /* 2723 /*
2727 if (tty->old_tty) 2724 if (tty->old_tty)
2728 xfree (tty->old_tty); 2725 {
2726 memset (tty->old_tty, 'Z', sizeof (struct emacs_tty));
2727 tty->old_tty = 0;
2728 }
2729
2730
2731 /* xfree (tty->old_tty);
2729 2732
2730 if (tty->Wcm) 2733 if (tty->Wcm)
2731 { 2734 {