diff options
| author | Karoly Lorentey | 2003-12-27 10:00:19 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2003-12-27 10:00:19 +0000 |
| commit | fca177d467f0264cab4256a67175fc52fba42f2e (patch) | |
| tree | aac26ce7368d3cffc254b50f4474b03430f025ee /README.multi-tty | |
| parent | 6548cf002c635f6799e2e127393128842be35632 (diff) | |
| download | emacs-fca177d467f0264cab4256a67175fc52fba42f2e.tar.gz emacs-fca177d467f0264cab4256a67175fc52fba42f2e.zip | |
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
Diffstat (limited to 'README.multi-tty')
| -rw-r--r-- | README.multi-tty | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/README.multi-tty b/README.multi-tty index ed2fb17770f..5d3e5f4f014 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -27,8 +27,8 @@ STATUS | |||
| 27 | Basic support is there; there are some rough edges, but it already | 27 | Basic support is there; there are some rough edges, but it already |
| 28 | seems to be usable. Input is read from all terminals (NOT via | 28 | seems to be usable. Input is read from all terminals (NOT via |
| 29 | MULTIKBOARD!). At the moment, the type of the new terminals must be | 29 | MULTIKBOARD!). At the moment, the type of the new terminals must be |
| 30 | the same as the initial terminal. Emacsclient was extended to support | 30 | the same as the initial terminal. Emacsclient has been extended to |
| 31 | opening a new terminal frame. | 31 | support opening a new terminal frame. |
| 32 | 32 | ||
| 33 | To try it out, start up the emacs server (M-x server-start), and then | 33 | To try it out, start up the emacs server (M-x server-start), and then |
| 34 | (from a shell prompt on another terminal) start emacsclient with | 34 | (from a shell prompt on another terminal) start emacsclient with |
| @@ -147,38 +147,68 @@ DIARY OF CHANGES | |||
| 147 | (Done, emacsclient signals Emacs after writing to the proxy pseudo | 147 | (Done, emacsclient signals Emacs after writing to the proxy pseudo |
| 148 | terminal. This means that multi-tty does not work with raw ttys!) | 148 | terminal. This means that multi-tty does not work with raw ttys!) |
| 149 | 149 | ||
| 150 | THINGS TO DO | ||
| 151 | ------------ | ||
| 152 | 150 | ||
| 153 | ** Implement sane error handling after initialization. (Currently | 151 | -- Make make-terminal-frame look up the `tty' and `tty-type' frame |
| 152 | parameters from the currently selected terminal before the global | ||
| 153 | default. | ||
| 154 | |||
| 155 | (Done.) | ||
| 156 | |||
| 157 | -- Put all cached terminal escape sequences into struct tty_output. | ||
| 158 | Currently, they are still stored in global variables, so we don't | ||
| 159 | really support multiple terminal types. | ||
| 160 | |||
| 161 | (Done.) | ||
| 162 | |||
| 163 | -- Implement sane error handling after initialization. (Currently | ||
| 154 | emacs exits if you specify a bad terminal type.) The helpful error | 164 | emacs exits if you specify a bad terminal type.) The helpful error |
| 155 | messages must still be provided when Emacs starts. | 165 | messages must still be provided when Emacs starts. |
| 156 | 166 | ||
| 157 | ** C-g should work on secondary terminals. | 167 | (Done.) |
| 168 | |||
| 169 | -- Implement terminal deletion, i.e., deleting local frames, closing | ||
| 170 | the tty device and restoring its previous state without exiting | ||
| 171 | Emacs. | ||
| 158 | 172 | ||
| 159 | ** Make make-terminal-frame look up the tty and tty-type parameters | 173 | (Done, but at the moment only called when an error happens during |
| 160 | from the currently selected terminal before the global default. | 174 | initialization. There is a memory corruption error around this |
| 175 | somewhere.) | ||
| 176 | |||
| 177 | |||
| 178 | THINGS TO DO | ||
| 179 | ------------ | ||
| 180 | |||
| 181 | ** Fix mysterious memory corruption error with tty deletion. To | ||
| 182 | trigger it, try the following shell command: | ||
| 183 | |||
| 184 | while true; do TERM=no-such-terminal-definition emacsclient -h; done | ||
| 185 | |||
| 186 | Emacs usually dumps core after a few dozen iterations. (The bug | ||
| 187 | seems to be related to the xfree()ing or bzero()ing of | ||
| 188 | tty_output.Wcm. Maybe there are outside references to struct Wcm? | ||
| 189 | Sounds logical, otherwise these vars would not have been collected | ||
| 190 | into a struct. But where?) | ||
| 191 | |||
| 192 | This does not seem to happen if the error occurs before terminal | ||
| 193 | initialization or if I comment out all xfree()s in delete_frame. | ||
| 194 | Update: yes it does, although it is much rarer. | ||
| 195 | |||
| 196 | ** C-g should work on secondary terminals. | ||
| 161 | 197 | ||
| 162 | ** Move optimalization parameters (costs) from union output_data to | 198 | ** Move optimalization parameters (costs) from union output_data to |
| 163 | a backend-neutral per-device structure. | 199 | a backend-neutral per-device structure. |
| 164 | 200 | ||
| 165 | ** Implement terminal deletion, i.e., deleting local frames, closing | ||
| 166 | the tty device and restoring its previous state without exiting | ||
| 167 | Emacs. This should be exported to the Lisp environment. | ||
| 168 | |||
| 169 | ** Implement automatic deletion of terminals when the last frame on | 201 | ** Implement automatic deletion of terminals when the last frame on |
| 170 | that terminal is closed. | 202 | that terminal is closed. |
| 171 | 203 | ||
| 172 | ** Put all cached terminal escape sequences into struct tty_output. | ||
| 173 | Currently, they are still stored in global variables, so we don't | ||
| 174 | really support multiple terminal types. | ||
| 175 | |||
| 176 | ** Make parts of struct tty_output accessible from Lisp. The device | 204 | ** Make parts of struct tty_output accessible from Lisp. The device |
| 177 | name and the type is sufficient. | 205 | name and the type is sufficient. |
| 178 | 206 | ||
| 207 | ** Export delete_tty to the Lisp environment. | ||
| 208 | |||
| 179 | ** Implement support for starting an interactive Emacs session without | 209 | ** Implement support for starting an interactive Emacs session without |
| 180 | an initial frame. (The user would connect to it and open frames | 210 | an initial frame. (The user would connect to it and open frames |
| 181 | later, with emacsclient.) Not necessary a good idea. | 211 | later, with emacsclient.) Not necessarily a good idea. |
| 182 | 212 | ||
| 183 | ** Support raw secondary terminals. (This one is tricky, SIGIO works | 213 | ** Support raw secondary terminals. (This one is tricky, SIGIO works |
| 184 | only on the controlling terminal.) | 214 | only on the controlling terminal.) |