comparison README.multi-tty @ 83008:040dd41ed7d0

Hookified termcap devices, added bootstrap display device, plus many bugfixes. lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells. lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells. src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations. (get_named_tty_display): New prototype. (tty_clear_end_of_line, term_init): Updated to new prototype. (initial_term_init): Renamed to init_initial_display. src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call. (update_frame): Don't flush the tty of there is no tty. (init_display): Set up a termcap display on the controlling tty and change the initial frame to use that. Delete the initial display. src/frame.c (Fframep): Return t for the initial frame. (make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init. (make_terminal_frame): Removed special cases for creating the initial frame. src/frame.h (enum output_method): New entry: output_initial for the bootstrap display. (FRAME_INITIAL_P): New macro. (make_initial_frame): New prototype. src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment. (init_keyboard): Added comment about exiting on SIGINT. (Fset_input_mode): A termcap frame is never the initial frame anymore. src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype. (reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call. src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes. src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook. src/term.c (initial_display): New variable. (tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to) (tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line) (tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions. (ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to) (clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs) (delete_glyphs, ins_del_lines): Removed special casing of termcap displays. (get_tty_display): New function. (Ftty_display_color_p, Ftty_display_color_cells): Use it. (get_named_tty_display): Removed static. (tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter instead of tty_display_info for hook compatibility. (set_terminal_modes, reset_terminal_modes): Removed. (initial_term_init): Renamed to init_initial_display. Set up an output_initial device, not a termcap display. (delete_initial_display): New function. (maybe_fatal): New function, for private use of term_init. (term_init): New parameter for choosing between fatal and simple errors. Removed incomprehensible special casing for the second initialization of the controlling tty. Use maybe_fatal for error handling. Initialize termcap display hooks in the new device. Initialize the display pointer in the tty_display_info structure. (delete_tty): Replace order of reset_sys_modes and delete_display. src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame. src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device. src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 09 Jan 2004 18:57:53 +0000
parents 7900111db01c
children b2b37c85b00a
comparison
equal deleted inserted replaced
83007:c0cb35d94ea7 83008:040dd41ed7d0
1 -*- coding: utf-8; -*- 1 -*- coding: utf-8; mode: text; -*-
2 GOAL 2 GOAL
3 ---- 3 ----
4 4
5 The ultimate goal of this branch is to implement support for opening 5 The ultimate goal of this branch is to implement support for opening
6 multiple, different tty devices and simultaneous X and tty frames from 6 multiple, different tty devices and simultaneous X and tty frames from
129 129
130 ** Fix color handling during X+tty combo sessions. (It seems that tty 130 ** Fix color handling during X+tty combo sessions. (It seems that tty
131 sessions automatically convert the face colors to terminal colors 131 sessions automatically convert the face colors to terminal colors
132 when the face is loaded. This conversion must happen instead on 132 when the face is loaded. This conversion must happen instead on
133 the fly in write_glyphs, which might be problematic, as color 133 the fly in write_glyphs, which might be problematic, as color
134 approximation is done in lisp (term/tty-colors.el).) 134 approximation is currently done in lisp (term/tty-colors.el).)
135
136 ** frame-creation-function should always create a frame that is on the
137 same display as the selected frame. Maybe frame-creation-function
138 should simply be removed and make-frame changed to do the right
139 thing.
135 140
136 ** The command `emacsclient -t -e '(delete-frame)'' fails to exit. 141 ** The command `emacsclient -t -e '(delete-frame)'' fails to exit.
137 142
138 ** Find out the best way to support suspending Emacs with multiple 143 ** Find out the best way to support suspending Emacs with multiple
139 ttys. My guess: disable it on the controlling tty, but from other 144 ttys. My guess: disable it on the controlling tty, but from other
140 ttys pass it on to emacsclient somehow. (It is (I hope) trivial to 145 ttys pass it on to emacsclient somehow. (It is (I hope) trivial to
141 extend emacsclient to handle suspend/resume. A `kill -STOP' almost 146 extend emacsclient to handle suspend/resume. A `kill -STOP' almost
142 works right now.) 147 works right now.)
143 148
149 ** If there are no frames on its controlling terminal, Emacs should
150 exit if the uses presses C-c there. (See the SIGTERM comment in
151 interrupt_signal on why this seems to be impossible to solve
152 generally.)
153
144 ** During an X session, Emacs seems to read from stdin. 154 ** During an X session, Emacs seems to read from stdin.
145 155
146 ** Move baud_rate to struct display. 156 ** Move baud_rate to struct display.
147 157
148 ** Do tty output through struct display, like graphical display 158 ** Do tty output through struct display, like graphical display
150 160
151 ** Implement support for starting an interactive Emacs session without 161 ** Implement support for starting an interactive Emacs session without
152 an initial frame. (The user would connect to it and open frames 162 an initial frame. (The user would connect to it and open frames
153 later, with emacsclient.) Not necessarily a good idea. 163 later, with emacsclient.) Not necessarily a good idea.
154 164
155 ** Fix Mac support (I can't do this myself). 165 ** Fix Mac support (I can't do this myself). Note that the current
156 166 state of Mac-specific source files in the multi-tty tree are not
157 ** Fix W32 support (I can't do this myself). 167 useful; before starting work on Mac support, revert to pristine,
158 168 pre-multi-tty versions.
159 ** Fix DOS support (I can't do this myself). 169
170 ** Fix W32 support (I can't do this myself). Note that the current
171 state of W32-specific source files in the multi-tty tree are not
172 useful; before starting work on W32 support, revert to pristine,
173 pre-multi-tty versions.
174
175 ** Fix DOS support (I can't do this myself). Note that the current
176 state of DOS-specific source files in the multi-tty tree are not
177 useful; before starting work on DOS support, revert to pristine,
178 pre-multi-tty versions.
160 179
161 ** Do a grep on XXX and ?? for more issues. 180 ** Do a grep on XXX and ?? for more issues.
162 181
163 ** Understand Emacs's low-level input system (it seems complicated) :-) 182 ** Understand Emacs's low-level input system (it seems complicated) :-)
164 What does interrupt_input do? I tried to disable it for raw 183 What does interrupt_input do? I tried to disable it for raw
347 trigger it, try the following shell command: 366 trigger it, try the following shell command:
348 367
349 while true; do TERM=no-such-terminal-definition emacsclient -h; done 368 while true; do TERM=no-such-terminal-definition emacsclient -h; done
350 369
351 Emacs usually dumps core after a few dozen iterations. (The bug 370 Emacs usually dumps core after a few dozen iterations. (The bug
352 seems to be related to the xfree()ing or bzero()ing of 371 seems to be related to the xfreeing or bzeroing of
353 tty_output.Wcm. Maybe there are outside references to struct Wcm? 372 tty_output.Wcm. Maybe there are outside references to struct Wcm?
354 Why were these vars collected into a struct before multi-tty 373 Why were these vars collected into a struct before multi-tty
355 support?) 374 support?)
356 375
357 (Done. Whew. It turned out that the problem had nothing to do 376 (Done. Whew. It turned out that the problem had nothing to do
358 with hypothetical external references to Wcm, or any other 377 with hypothetical external references to Wcm, or any other
359 tty_output component; it was simply that delete_tty closed the 378 tty_output component; it was simply that delete_tty closed the
360 filehandles of secondary ttys twice, resulting in fclose doubly 379 filehandles of secondary ttys twice, resulting in fclose doubly
361 free()ing memory. Utterly trivial matter. I love the C's memory 380 freeing memory. Utterly trivial matter. I love the C's memory
362 management, it puts hair on your chest.) 381 management, it puts hair on your chest.)
363 382
364 -- Support raw secondary terminals. (Note that SIGIO works only on 383 -- Support raw secondary terminals. (Note that SIGIO works only on
365 the controlling terminal.) Hint: extend read_input_waiting() for 384 the controlling terminal.) Hint: extend read_input_waiting for
366 multiple ttys and hopefully this will be fixed. 385 multiple ttys and hopefully this will be fixed.
367 386
368 (Done, it seems to have been working already for some time. It 387 (Done, it seems to have been working already for some time. It
369 seems F_SETOWN does work, after all. Not sure what made it fail 388 seems F_SETOWN does work, after all. Not sure what made it fail
370 earlier, but it seems to be fixed (there were several changes 389 earlier, but it seems to be fixed (there were several changes
371 around request_sigio, maybe one of them did it). 390 around request_sigio, maybe one of them did it).
372 read_input_waiting() is only used in sys_select(), don't change 391 read_input_waiting is only used in sys_select, don't change
373 it.) (Update: After adding X support, it's broken again.) 392 it.) (Update: After adding X support, it's broken again.)
374 393
375 -- Find out why does Emacs abort when it wants to close its 394 -- Find out why does Emacs abort when it wants to close its
376 controlling tty. Hint: chan_process[] array. Hey, maybe 395 controlling tty. Hint: chan_process[] array. Hey, maybe
377 noninterrupt-IO would work, too? Update: no, there is no process 396 noninterrupt-IO would work, too? Update: no, there is no process
379 398
380 (Done. Added add/delete_keyboard_wait_descriptor to 399 (Done. Added add/delete_keyboard_wait_descriptor to
381 term_init/delete_tty. The hint was right, in a way.) 400 term_init/delete_tty. The hint was right, in a way.)
382 401
383 -- Issue with SIGIO: it needs to be disabled during redisplay. See if 402 -- Issue with SIGIO: it needs to be disabled during redisplay. See if
384 fcntl() kernel behaviour could be emulated by emacsclient. 403 fcntl kernel behaviour could be emulated by emacsclient.
385 404
386 (Done. Simply disabled the SIGIO emulation hack in emacsclient.) 405 (Done. Simply disabled the SIGIO emulation hack in emacsclient.)
387 (Update: it was added back.) 406 (Update: it was added back.)
388 407
389 -- server.el: There are issues with saving files in buffers of closed 408 -- server.el: There are issues with saving files in buffers of closed