Commit 04c3243c authored by Karoly Lorentey's avatar Karoly Lorentey

Trivial changes

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-18
parent 8ed48c27
...@@ -28,7 +28,8 @@ Basic multi-tty support is there; there are some rough edges, but it ...@@ -28,7 +28,8 @@ Basic multi-tty support is there; there are some rough edges, but it
already seems to be usable. Emacsclient has been extended to support already seems to be usable. Emacsclient has been extended to support
opening a new terminal frame. opening a new terminal frame.
To try it out, compile Emacs with the following commands To try it out, compile the multi-tty branch with the following
commands:
mkdir +build mkdir +build
cd +build cd +build
...@@ -38,17 +39,24 @@ To try it out, compile Emacs with the following commands ...@@ -38,17 +39,24 @@ To try it out, compile Emacs with the following commands
then start up the emacs server (src/emacs, M-x server-start), and then then start up the emacs server (src/emacs, M-x server-start), and then
(from a shell prompt on another terminal) start emacsclient with (from a shell prompt on another terminal) start emacsclient with
lib-src/emacsclient -h lib-src/emacsclient -h /optional/file/names...
You'll hopefully have two fully working frames on separate terminals. You'll hopefully have two fully working, independent frames on
If you exit emacs, both terminals should be restored to their previous separate terminals. (This seems to be very useful, emacsclient starts
states. You can close the newly opened frame and return to the shell up even faster than vi!) :-) You can close the newly opened frame and
without exiting Emacs by pressing C-x 5 0, i.e., delete-frame. return to the shell without exiting Emacs by pressing C-x 5 0, i.e.,
delete-frame. (Note that this does not seem to work yet on the
original terminal.) Creating new frames on the same tty with C-x 5 2
works exactly as before. Suspending Emacs is disabled at the moment.
If you exit emacs, all terminals should be restored to their previous
states.
X, Mac, Windows and DOS support is broken, probably doesn't even X, Mac, Windows and DOS support is broken, probably doesn't even
compile -- this will be solved later. compile -- this will be solved later. Please see the attached README
for other issues, implementation notes and sub-TODO items.
Only tested on my GNU/Linux box.
Tested under GNU/Linux only.
NEWS NEWS
---- ----
......
...@@ -134,8 +134,7 @@ addcol (tty, n) { ...@@ -134,8 +134,7 @@ addcol (tty, n) {
* after we reach the last column; this takes us to a known state. * after we reach the last column; this takes us to a known state.
*/ */
void void
cmcheckmagic (tty) cmcheckmagic (struct tty_output *tty)
struct tty_output *tty;
{ {
if (curX (tty) == FrameCols (tty)) if (curX (tty) == FrameCols (tty))
{ {
......
...@@ -166,10 +166,10 @@ extern int evalcost (); ...@@ -166,10 +166,10 @@ extern int evalcost ();
extern struct tty_output *current_tty; extern struct tty_output *current_tty;
extern void cmcheckmagic P_ ((struct tty_output *)); extern void cmcheckmagic P_ ((struct tty_output *));
extern int cmputc P_ ((int)); extern int cmputc P_ ((int));
extern void cmcostinit P_ ((struct tty_output *tty)); extern void cmcostinit P_ ((struct tty_output *));
extern void cmgoto P_ ((struct tty_output *, int, int)); extern void cmgoto P_ ((struct tty_output *, int, int));
extern void Wcm_clear P_ ((struct tty_output *tty)); extern void Wcm_clear P_ ((struct tty_output *));
extern int Wcm_init P_ ((struct tty_output *tty)); extern int Wcm_init P_ ((struct tty_output *));
/* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
(do not change this comment) */ (do not change this comment) */
...@@ -917,18 +917,19 @@ insert_glyphs (start, len) ...@@ -917,18 +917,19 @@ insert_glyphs (start, len)
{ {
char *buf; char *buf;
struct glyph *glyph = NULL; struct glyph *glyph = NULL;
struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); struct frame *f;
struct tty_output *tty; struct tty_output *tty;
if (len <= 0) if (len <= 0)
return; return;
if (insert_glyphs_hook && ! FRAME_TERMCAP_P (f)) if (insert_glyphs_hook)
{ {
(*insert_glyphs_hook) (start, len); (*insert_glyphs_hook) (start, len);
return; return;
} }
f = (updating_frame ? updating_frame : XFRAME (selected_frame));
tty = FRAME_TTY (f); tty = FRAME_TTY (f);
if (tty->TS_ins_multi_chars) if (tty->TS_ins_multi_chars)
...@@ -2156,11 +2157,9 @@ term_init (name, terminal_type) ...@@ -2156,11 +2157,9 @@ term_init (name, terminal_type)
tty_list = tty; tty_list = tty;
} }
if (tty->Wcm) if (! tty->Wcm)
Wcm_clear (tty); tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
else
tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
if (name) if (name)
{ {
int fd; int fd;
...@@ -2676,24 +2675,6 @@ delete_tty (struct tty_output *tty) ...@@ -2676,24 +2675,6 @@ delete_tty (struct tty_output *tty)
{ {
Lisp_Object tail, frame; Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
if (FRAME_LIVE_P (f) && FRAME_TTY (f) == tty)
{
Fdelete_frame (frame, Qt);
f->output_data.tty = 0;
}
}
/* Close the terminal and free memory. */
delete_tty_1 (tty);
}
static void
delete_tty_1 (struct tty_output *tty)
{
if (tty == tty_list) if (tty == tty_list)
tty_list = tty->next; tty_list = tty->next;
else else
...@@ -2709,13 +2690,25 @@ delete_tty_1 (struct tty_output *tty) ...@@ -2709,13 +2690,25 @@ delete_tty_1 (struct tty_output *tty)
p->next = p->next->next; p->next = p->next->next;
} }
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
if (FRAME_LIVE_P (f) && FRAME_TTY (f) == tty)
{
Fdelete_frame (frame, Qt);
f->output_data.tty = 0;
}
}
/* This hangs. */ /* This hangs. */
/* reset_sys_modes (tty); */ /*
reset_sys_modes (tty);
if (tty->name) if (tty->name)
xfree (tty->name); xfree (tty->name);
if (tty->type) if (tty->type)
xfree (tty->type); xfree (tty->type);
*/
if (tty->input) if (tty->input)
fclose (tty->input); fclose (tty->input);
if (tty->output) if (tty->output)
...@@ -2723,9 +2716,19 @@ delete_tty_1 (struct tty_output *tty) ...@@ -2723,9 +2716,19 @@ delete_tty_1 (struct tty_output *tty)
if (tty->termscript) if (tty->termscript)
fclose (tty->termscript); fclose (tty->termscript);
tty->input = 0;
tty->output = 0;
tty->termscript = 0;
/* /*
if (tty->old_tty) if (tty->old_tty)
xfree (tty->old_tty); {
memset (tty->old_tty, 'Z', sizeof (struct emacs_tty));
tty->old_tty = 0;
}
/* xfree (tty->old_tty);
if (tty->Wcm) if (tty->Wcm)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment