Mercurial > emacs
comparison README.multi-tty @ 82991:2b26656ff804
MULTI_KBOARD support for ttys. Input-related bugfixes for X+tty sessions.
lib-src/emacsclient.c (pty_conversation): Fix errno check for read from fileno(in).
src/config.in: Unconditionally define MULTI_KBOARD.
src/frame.c (make_terminal_frame): Initialize f->kboard.
src/keyboard.c (cmd_error_internal): Don't kill Emacs if a Quit was
pressed on the tty of a X+tty session.
(read_avail_input): Initialize nread to zero. Abort if there is no
tty after a termcap read.
(interrupt_signal)[USG]: Always reset signal handler.
(init_keyboard): Always set signal handler for SIGINT/SIGQUIT if
noninteractive.
src/term.c (term_dummy_init): Initialize kboard to the initial_kboard.
(term_init): Free component structures of the initial tty. Clear xmalloced structures.
Moved rif initialization to syms_of_term.
(term_init)[MULTI_KBOARD]: Initialize tty->kboard.
(delete_tty)[MULTI_KBOARD]: Delete the keyboard.
(syms_of_term): Initialize tty_display_method_template.
src/termchar.h (tty_output)[MULTI_KBOARD]: Added kboard member.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-31
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Fri, 02 Jan 2004 02:54:17 +0000 |
parents | 2ecd1f669db9 |
children | 5de4189e659d |
comparison
equal
deleted
inserted
replaced
82990:2ecd1f669db9 | 82991:2b26656ff804 |
---|---|
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 |
7 a single Emacs session. | 7 a single Emacs session. |
8 | 8 |
9 Some use cases: | |
10 | |
11 Emacs is notoriously slow at startup, so most people use another | |
12 editor or emacsclient for quick editing jobs from the console. | |
13 Unfortunately, emacsclient was very awkward to use, because it did not | |
14 support opening a new Emacs frame on the current virtual console. | |
15 Now, with multi-tty support, it can do that. (Emacsclient starts up | |
16 faster than vi!) | |
17 | |
18 Some Gnus users (including me) run Gnus in an X frame in its own Emacs | |
19 instance, which they typically leave running for weeks. It would be | |
20 nice if they could connect to this instance from a remote ssh session | |
21 and check their messages without opening a remote X frame or resorting | |
22 to gnus-slave. | |
23 | |
24 | |
9 WHO IS DOING IT | 25 WHO IS DOING IT |
10 --------------- | 26 --------------- |
11 | 27 |
12 I'm Károly Lőrentey. My address: lorentey@elte.hu. | 28 I'm Károly Lőrentey. My address: lorentey@elte.hu. |
13 | 29 |
16 Retrieving the latest version of the branch: | 32 Retrieving the latest version of the branch: |
17 | 33 |
18 tla register-archive lorentey@elte.hu--2004 http://lorentey.web.elte.hu/arch/2004/ | 34 tla register-archive lorentey@elte.hu--2004 http://lorentey.web.elte.hu/arch/2004/ |
19 tla get lorentey@elte.hu--2004/emacs--multi-tty <directory> | 35 tla get lorentey@elte.hu--2004/emacs--multi-tty <directory> |
20 | 36 |
21 (I use tla 1.1.) | 37 (I use a recent arch development snapshot, but any of the released |
22 | 38 versions of arch will do fine, I think.) |
39 | |
40 If you don't have arch, the branch has a homepage from which you can | |
41 download conventional patches against Emacs CVS HEAD: | |
42 | |
43 http://lorentey.web.elte.hu/project/emacs.html | |
23 | 44 |
24 STATUS | 45 STATUS |
25 ------ | 46 ------ |
26 | 47 |
27 Basic multi-tty support is there; there are some rough edges, but it | 48 Multi-tty support is stable, I think most of the problems were fixed. |
28 already seems to be usable. Emacsclient has been extended to support | 49 (It still needs testing on other architectures, though.) Please let |
29 opening a new terminal frame. | 50 me know if you find any bugs in it. Emacsclient has been extended to |
30 | 51 support opening a new terminal frame. |
31 To try it out, compile the multi-tty branch with the following | 52 |
53 To try it out, compile and run the multi-tty branch with the following | |
32 commands: | 54 commands: |
33 | 55 |
34 mkdir +build | 56 mkdir +build |
35 cd +build | 57 cd +build |
36 ../configure | 58 ../configure |
37 make bootstrap | 59 make bootstrap |
38 | 60 src/emacs -nw |
39 then start up the emacs server (src/emacs -nw, M-x server-start), and | 61 M-x server-start |
40 then (from a shell prompt on another terminal) start emacsclient with | 62 |
41 | 63 and then (from a shell prompt on another terminal) start emacsclient |
42 lib-src/emacsclient -f /optional/file/names... | 64 with |
65 | |
66 lib-src/emacsclient -t /optional/file/names... | |
43 | 67 |
44 You'll hopefully have two fully working, independent frames on | 68 You'll hopefully have two fully working, independent frames on |
45 separate terminals. (This seems to be very useful, emacsclient starts | 69 separate terminals. The new frame is closed automatically when you |
46 up even faster than vi!) :-) You can close the newly opened frame and | 70 have finished editing the specified files (C-x #), but delete-frame |
47 return to the shell without exiting Emacs by pressing C-x 5 0, i.e., | 71 (C-x 5 0) also works. Of course, you can create frames on more than |
48 delete-frame. Creating new frames on the same tty with C-x 5 2 | 72 two tty devices. |
49 works exactly as before. Suspending Emacs is disabled at the moment. | 73 |
50 If you exit emacs, all terminals should be restored to their previous | 74 Creating new frames on the same tty with C-x 5 2 works, and they |
51 states. | 75 behave the same way as in previous Emacs versions. If you exit emacs, |
52 | 76 all terminals should be restored to their previous states. |
53 X support is (I hope) working, but at the moment there are problems | 77 |
54 with simultaneous X and tty devices, so don't do that. | 78 This is work in progress, and probably full of bugs. You should |
55 | 79 always run emacs from gdb, so that you'll have a live instance to |
56 Mac, Windows and DOS support is broken, probably doesn't even | 80 debug if something goes wrong. Please send me your reports. |
57 compile -- this will be solved later. | 81 |
58 | 82 Problems: |
59 Only tested on my GNU/Linux box. | 83 |
60 | 84 * Suspending Emacs is disabled if there are multiple tty |
85 devices. Also, there is no way to suspend emacsclient. This | |
86 will be fixed. | |
87 | |
88 * X support is (I hope) working, but at the moment there are | |
89 problems with simultaneous X and tty devices, so don't do | |
90 that - start a separate Emacs with -nw and run the server | |
91 there. | |
92 | |
93 * Mac, Windows and DOS support is broken, probably doesn't | |
94 even compile -- this will be solved later. | |
95 | |
96 * Only tested on my GNU/Linux box. | |
61 | 97 |
62 NEWS | 98 NEWS |
63 ---- | 99 ---- |
64 | 100 |
65 For the NEWS file: | 101 For the NEWS file: |
86 CHANGELOG | 122 CHANGELOG |
87 --------- | 123 --------- |
88 | 124 |
89 See arch logs. | 125 See arch logs. |
90 | 126 |
91 | |
92 DIARY OF CHANGES | |
93 ---------------- | |
94 | |
95 (ex-TODO items with explanations.) | |
96 | |
97 -- Introduce a new struct for terminal devices. | |
98 | |
99 (Done, see struct tty_output. The list of members is not yet | |
100 complete.) | |
101 | |
102 -- Change the bootstrap procedure to initialize tty_list. | |
103 | |
104 (Done, but needs review.) | |
105 | |
106 -- Change make-terminal-frame to support specifying another tty. | |
107 | |
108 (Done, new frame parameters: `tty' and `tty-type'.) | |
109 | |
110 -- Implement support for reading from multiple terminals. | |
111 | |
112 (Done, read_avail_input tries to read from each terminal, until one | |
113 succeeds. MULTI_KBOARD is not used. Secondary terminals don't send | |
114 SIGIO!) | |
115 | |
116 (Update: They do, now.) | |
117 | |
118 (Update2: After enabling X, they don't.) | |
119 | |
120 -- other-frame should cycle through the frames on the `current' | |
121 terminal only. | |
122 | |
123 (Done, by trivially modifiying next_frame and prev_frame.) | |
124 | |
125 -- Support different terminal sizes. | |
126 | |
127 (Done, no problem.) | |
128 | |
129 -- Make sure terminal resizes are handled gracefully. (Could be | |
130 problematic.) | |
131 | |
132 (Done. We don't get automatic SIGWINCH for additional ttys, | |
133 though.) | |
134 | |
135 -- Extend emacsclient to automatically open a new tty when it connects | |
136 to Emacs. | |
137 | |
138 (Done. It's an ugly hack, needs more work.) | |
139 | |
140 -- Redisplay must refresh the topmost frame on *all* terminals, not | |
141 just the initial terminal. | |
142 | |
143 (Done, but introduced an ugly redisplay problems. Ugh.) | |
144 | |
145 -- Fix redisplay problems. | |
146 | |
147 (Done; it turned out that the entire Wcm structure must be moved | |
148 inside tty_output. Why didn't I catch this earlier?) | |
149 | |
150 -- Provide a way for emacsclient to tell Emacs that the tty has been | |
151 resized. | |
152 | |
153 (Done, simply forward the SIGWINCH signal.) | |
154 | |
155 -- Each keypress should automatically select the frame corresponding | |
156 to the terminal that it was coming from. This means that Emacs | |
157 must know from which terminal the last keyboard event came from. | |
158 | |
159 (Done, it was quite simple, the input event system already | |
160 supported multiple frames.) | |
161 | |
162 -- Fix SIGIO issue with secondary terminals. | |
163 | |
164 (Done, emacsclient signals Emacs after writing to the proxy pseudo | |
165 terminal. Note that this means that multi-tty does not work with | |
166 raw ttys!) | |
167 | |
168 (Update: This is bullshit. There is a read_input_waiting function, | |
169 extend that somehow.) | |
170 | |
171 (Update of update: The first update was not right either, extending | |
172 read_input_waiting was not necessary. Secondary ttys do seem to | |
173 send signals on input.) | |
174 | |
175 (Update^3: Not any more.) | |
176 | |
177 -- Make make-terminal-frame look up the `tty' and `tty-type' frame | |
178 parameters from the currently selected terminal before the global | |
179 default. | |
180 | |
181 (Done.) | |
182 | |
183 -- Put all cached terminal escape sequences into struct tty_output. | |
184 Currently, they are still stored in global variables, so we don't | |
185 really support multiple terminal types. | |
186 | |
187 (Done. It was not fun.) | |
188 | |
189 -- Implement sane error handling after initialization. (Currently | |
190 emacs exits if you specify a bad terminal type.) The helpful error | |
191 messages must still be provided when Emacs starts. | |
192 | |
193 (Done.) | |
194 | |
195 -- Implement terminal deletion, i.e., deleting local frames, closing | |
196 the tty device and restoring its previous state without exiting | |
197 Emacs. | |
198 | |
199 (Done, but at the moment only called when an error happens during | |
200 initialization. There is a memory corruption error around this | |
201 somewhere.) (Update: now it is fully enabled.) | |
202 | |
203 -- Implement automatic deletion of terminals when the last frame on | |
204 that terminal is closed. | |
205 | |
206 (Done.) | |
207 | |
208 -- Restore tty screen after closing the terminal. | |
209 | |
210 (Done, we do the same as Emacs 21.2 for all terminals.) | |
211 | |
212 -- 'TERM=dumb src/emacs' does not restore the terminal state. | |
213 | |
214 (Done.) | |
215 | |
216 -- C-g should work on secondary terminals. | |
217 | |
218 (Done, but the binding is not configurable.) | |
219 | |
220 -- Deal with SIGHUP in Emacs and in emacsclient. (After this, the | |
221 server-frames may be removed from server.el.) | |
222 | |
223 (Done, nothing to do. It seems that Emacs does not receive SIGHUP | |
224 from secondary ttys, which is actually a good thing.) (Update: I | |
225 think it would be a bad idea to remove server-frames anyway.) | |
226 | |
227 -- Change emacsclient/server.el to support the -t argument better, | |
228 i.e. automatically close the socket when the frame is closed. | |
229 | |
230 (Seems to be working OK.) | |
231 | |
232 -- Fix mysterious memory corruption error with tty deletion. To | |
233 trigger it, try the following shell command: | |
234 | |
235 while true; do TERM=no-such-terminal-definition emacsclient -h; done | |
236 | |
237 Emacs usually dumps core after a few dozen iterations. (The bug | |
238 seems to be related to the xfree()ing or bzero()ing of | |
239 tty_output.Wcm. Maybe there are outside references to struct Wcm? | |
240 Why were these vars collected into a struct before multi-tty | |
241 support?) | |
242 | |
243 (Done. Whew. It turned out that the problem had nothing to do | |
244 with hypothetical external references to Wcm, or any other | |
245 tty_output component; it was simply that delete_tty closed the | |
246 filehandles of secondary ttys twice, resulting in fclose doubly | |
247 free()ing memory. Utterly trivial matter. I love the C's memory | |
248 management, it puts hair on your chest.) | |
249 | |
250 -- Support raw secondary terminals. (Note that SIGIO works only on | |
251 the controlling terminal.) Hint: extend read_input_waiting() for | |
252 multiple ttys and hopefully this will be fixed. | |
253 | |
254 (Done, it seems to have been working already for some time. It | |
255 seems F_SETOWN does work, after all. Not sure what made it fail | |
256 earlier, but it seems to be fixed (there were several changes | |
257 around request_sigio, maybe one of them did it). | |
258 read_input_waiting() is only used in sys_select(), don't change | |
259 it.) (Update: After adding X support, it's broken again.) | |
260 | |
261 -- Find out why does Emacs abort when it wants to close its | |
262 controlling tty. Hint: chan_process[] array. Hey, maybe | |
263 noninterrupt-IO would work, too? Update: no, there is no process | |
264 for stdin/out. | |
265 | |
266 (Done. Added add/delete_keyboard_wait_descriptor to | |
267 term_init/delete_tty. The hint was right, in a way.) | |
268 | |
269 -- Issue with SIGIO: it needs to be disabled during redisplay. See if | |
270 fcntl() kernel behaviour could be emulated by emacsclient. | |
271 | |
272 (Done. Simply disabled the SIGIO emulation hack in emacsclient.) | |
273 (Update: it was added back.) | |
274 | |
275 -- server.el: There are issues with saving files in buffers of closed | |
276 clients. Try editing a file with emacsclient -f, and (without | |
277 saving it) do a delete-frame. The frame is closed without | |
278 question, and a surprising confirmation prompt appears in another | |
279 frame. | |
280 | |
281 (Done. delete-frame now asks for confirmation if it still has | |
282 pending buffers, and modified buffers don't seem to be deleted.) | |
283 | |
284 -- emacsclient.el, server.el: Handle eval or file open errors when | |
285 doing -t. | |
286 | |
287 (Done.) | |
288 | |
289 -- Make parts of struct tty_output accessible from Lisp. The device | |
290 name and the type is sufficient. | |
291 | |
292 (Done, see frame-tty-name and frame-tty-type.) | |
293 | |
294 -- Export delete_tty to the Lisp environment, for emacsclient. | |
295 | |
296 (Done, see delete-tty.) | |
297 | |
298 -- Get rid of the accessor macros in termchar.h, or define macros for | |
299 all members. | |
300 | |
301 (Done.) | |
302 | |
303 -- Move device-specific parameters (like costs) commonly used by | |
304 device backends to a common, device-dependent structure. | |
305 | |
306 (Done. See struct display_method in termhooks.h.) | |
307 | |
308 -- Fix X support. | |
309 | |
310 (Done. Well, it seems to be working.) | |
311 | |
312 -- Allow simultaneous X and tty frames. (Handling input could be | |
313 tricky. Or maybe not.) | |
314 | |
315 (Done. Allowed, that is. It is currently extremely unstable, to | |
316 the point of being unusable. The rif variable causes constant | |
317 core dumps. Handling input is indeed tricky.) | |
318 | |
319 THINGS TO DO | 127 THINGS TO DO |
320 ------------ | 128 ------------ |
321 | 129 |
322 ** Fix rif issue with X-tty combo sessions. IMHO the best thing to do | 130 ** Fix rif issue with X-tty combo sessions. IMHO the best thing to do |
323 is to get rid of that global variable (and use the value value in | 131 is to get rid of that global variable (and use the value value in |
324 display_method, which is guaranteed to be correct). | 132 display_method, which is guaranteed to be correct). |
325 | 133 |
326 ** Fix faces on tty frames during X-tty combo sessions. | 134 ** Fix faces on tty frames during X-tty combo sessions. |
135 | |
136 ** During an X-tty combo session, a (message "Hello") from a tty frame | |
137 goes to the X frame. Fix this. | |
327 | 138 |
328 ** Find out the best way to support suspending Emacs with multiple | 139 ** Find out the best way to support suspending Emacs with multiple |
329 ttys. My guess: disable it on the controlling tty, but from other | 140 ttys. My guess: disable it on the controlling tty, but from other |
330 ttys pass it on to emacsclient somehow. (It is (I hope) trivial to | 141 ttys pass it on to emacsclient somehow. (It is (I hope) trivial to |
331 extend emacsclient to handle suspend/resume. A `kill -STOP' almost | 142 extend emacsclient to handle suspend/resume. A `kill -STOP' almost |
347 | 158 |
348 ** Fix DOS support (I can't do this myself). | 159 ** Fix DOS support (I can't do this myself). |
349 | 160 |
350 ** Do a grep on XXX and ?? for more issues. | 161 ** Do a grep on XXX and ?? for more issues. |
351 | 162 |
352 ** Understand Emacs's low-level input system (it seems complicated) | 163 ** Understand Emacs's low-level input system (it seems complicated) :-) |
353 :-) and maybe rewrite multi-tty input in terms of MULTI_KBOARD. | |
354 (Update: This backtrace from a tty-X combo session hints that this | |
355 may be necessary.) | |
356 | |
357 #0 abort () at /home/lorentey/work/emacs/emacs--multi-tty/src/emacs.c:417 | |
358 #1 0x081104fb in read_char (commandflag=0, nmaps=0, maps=0x0, prev_event=675499188, used_mouse_menu=0x0) at /home/lorentey/work/emacs/emacs--multi-tty/src/keyboard.c:2581 | |
359 #2 0x0819f23e in read_filtered_event (no_switch_frame=1, ascii_required=0, error_nonascii=0, input_method=0) at /home/lorentey/work/emacs/emacs--multi-tty/src/lread.c:468 | |
360 #3 0x0819387c in Fy_or_n_p (prompt=1759896324) at /home/lorentey/work/emacs/emacs--multi-tty/src/fns.c:3115 | |
361 ... | |
362 | 164 |
363 ** What does interrupt_input do? I tried to disable it for raw | 165 ** What does interrupt_input do? I tried to disable it for raw |
364 secondary tty support, but it does not seem to do anything useful. | 166 secondary tty support, but it does not seem to do anything useful. |
365 (Update: Look again. X unconditionally enables this, maybe that's | 167 (Update: Look again. X unconditionally enables this, maybe that's |
366 why raw terminal support is broken again. I really do need to | 168 why raw terminal support is broken again. I really do need to |
385 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0}) | 187 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0}) |
386 gettimeofday({1072842297, 748245}, NULL) = 0 | 188 gettimeofday({1072842297, 748245}, NULL) = 0 |
387 | 189 |
388 I have not been able to reproduce this. | 190 I have not been able to reproduce this. |
389 | 191 |
192 ** Define a output_initial value for output_method for the initial | |
193 frame that is dumped with Emacs. Checking for this frame (e.g. in | |
194 cmd_error_internal) is ugly. | |
195 | |
196 ** emacsclient -t from an Emacs term buffer does not work, complains | |
197 about face problems. This can even lock up Emacs (if the recursive | |
198 frame sets single_kboard). | |
199 | |
200 DIARY OF CHANGES | |
201 ---------------- | |
202 | |
203 (ex-TODO items with explanations.) | |
204 | |
205 -- Introduce a new struct for terminal devices. | |
206 | |
207 (Done, see struct tty_output. The list of members is not yet | |
208 complete.) | |
209 | |
210 -- Change the bootstrap procedure to initialize tty_list. | |
211 | |
212 (Done, but needs review.) | |
213 | |
214 -- Change make-terminal-frame to support specifying another tty. | |
215 | |
216 (Done, new frame parameters: `tty' and `tty-type'.) | |
217 | |
218 -- Implement support for reading from multiple terminals. | |
219 | |
220 (Done, read_avail_input tries to read from each terminal, until one | |
221 succeeds. MULTI_KBOARD is not used. Secondary terminals don't send | |
222 SIGIO!) | |
223 | |
224 (Update: They do, now.) | |
225 | |
226 (Update2: After enabling X, they don't.) | |
227 | |
228 -- other-frame should cycle through the frames on the `current' | |
229 terminal only. | |
230 | |
231 (Done, by trivially modifiying next_frame and prev_frame.) | |
232 | |
233 -- Support different terminal sizes. | |
234 | |
235 (Done, no problem.) | |
236 | |
237 -- Make sure terminal resizes are handled gracefully. (Could be | |
238 problematic.) | |
239 | |
240 (Done. We don't get automatic SIGWINCH for additional ttys, | |
241 though.) | |
242 | |
243 -- Extend emacsclient to automatically open a new tty when it connects | |
244 to Emacs. | |
245 | |
246 (Done. It's an ugly hack, needs more work.) | |
247 | |
248 -- Redisplay must refresh the topmost frame on *all* terminals, not | |
249 just the initial terminal. | |
250 | |
251 (Done, but introduced an ugly redisplay problems. Ugh.) | |
252 | |
253 -- Fix redisplay problems. | |
254 | |
255 (Done; it turned out that the entire Wcm structure must be moved | |
256 inside tty_output. Why didn't I catch this earlier?) | |
257 | |
258 -- Provide a way for emacsclient to tell Emacs that the tty has been | |
259 resized. | |
260 | |
261 (Done, simply forward the SIGWINCH signal.) | |
262 | |
263 -- Each keypress should automatically select the frame corresponding | |
264 to the terminal that it was coming from. This means that Emacs | |
265 must know from which terminal the last keyboard event came from. | |
266 | |
267 (Done, it was quite simple, the input event system already | |
268 supported multiple frames.) | |
269 | |
270 -- Fix SIGIO issue with secondary terminals. | |
271 | |
272 (Done, emacsclient signals Emacs after writing to the proxy pseudo | |
273 terminal. Note that this means that multi-tty does not work with | |
274 raw ttys!) | |
275 | |
276 (Update: This is bullshit. There is a read_input_waiting function, | |
277 extend that somehow.) | |
278 | |
279 (Update of update: The first update was not right either, extending | |
280 read_input_waiting was not necessary. Secondary ttys do seem to | |
281 send signals on input.) | |
282 | |
283 (Update^3: Not any more.) | |
284 | |
285 -- Make make-terminal-frame look up the `tty' and `tty-type' frame | |
286 parameters from the currently selected terminal before the global | |
287 default. | |
288 | |
289 (Done.) | |
290 | |
291 -- Put all cached terminal escape sequences into struct tty_output. | |
292 Currently, they are still stored in global variables, so we don't | |
293 really support multiple terminal types. | |
294 | |
295 (Done. It was not fun.) | |
296 | |
297 -- Implement sane error handling after initialization. (Currently | |
298 emacs exits if you specify a bad terminal type.) The helpful error | |
299 messages must still be provided when Emacs starts. | |
300 | |
301 (Done.) | |
302 | |
303 -- Implement terminal deletion, i.e., deleting local frames, closing | |
304 the tty device and restoring its previous state without exiting | |
305 Emacs. | |
306 | |
307 (Done, but at the moment only called when an error happens during | |
308 initialization. There is a memory corruption error around this | |
309 somewhere.) (Update: now it is fully enabled.) | |
310 | |
311 -- Implement automatic deletion of terminals when the last frame on | |
312 that terminal is closed. | |
313 | |
314 (Done.) | |
315 | |
316 -- Restore tty screen after closing the terminal. | |
317 | |
318 (Done, we do the same as Emacs 21.2 for all terminals.) | |
319 | |
320 -- 'TERM=dumb src/emacs' does not restore the terminal state. | |
321 | |
322 (Done.) | |
323 | |
324 -- C-g should work on secondary terminals. | |
325 | |
326 (Done, but the binding is not configurable.) | |
327 | |
328 -- Deal with SIGHUP in Emacs and in emacsclient. (After this, the | |
329 server-frames may be removed from server.el.) | |
330 | |
331 (Done, nothing to do. It seems that Emacs does not receive SIGHUP | |
332 from secondary ttys, which is actually a good thing.) (Update: I | |
333 think it would be a bad idea to remove server-frames.) | |
334 | |
335 -- Change emacsclient/server.el to support the -t argument better, | |
336 i.e. automatically close the socket when the frame is closed. | |
337 | |
338 (Seems to be working OK.) | |
339 | |
340 -- Fix mysterious memory corruption error with tty deletion. To | |
341 trigger it, try the following shell command: | |
342 | |
343 while true; do TERM=no-such-terminal-definition emacsclient -h; done | |
344 | |
345 Emacs usually dumps core after a few dozen iterations. (The bug | |
346 seems to be related to the xfree()ing or bzero()ing of | |
347 tty_output.Wcm. Maybe there are outside references to struct Wcm? | |
348 Why were these vars collected into a struct before multi-tty | |
349 support?) | |
350 | |
351 (Done. Whew. It turned out that the problem had nothing to do | |
352 with hypothetical external references to Wcm, or any other | |
353 tty_output component; it was simply that delete_tty closed the | |
354 filehandles of secondary ttys twice, resulting in fclose doubly | |
355 free()ing memory. Utterly trivial matter. I love the C's memory | |
356 management, it puts hair on your chest.) | |
357 | |
358 -- Support raw secondary terminals. (Note that SIGIO works only on | |
359 the controlling terminal.) Hint: extend read_input_waiting() for | |
360 multiple ttys and hopefully this will be fixed. | |
361 | |
362 (Done, it seems to have been working already for some time. It | |
363 seems F_SETOWN does work, after all. Not sure what made it fail | |
364 earlier, but it seems to be fixed (there were several changes | |
365 around request_sigio, maybe one of them did it). | |
366 read_input_waiting() is only used in sys_select(), don't change | |
367 it.) (Update: After adding X support, it's broken again.) | |
368 | |
369 -- Find out why does Emacs abort when it wants to close its | |
370 controlling tty. Hint: chan_process[] array. Hey, maybe | |
371 noninterrupt-IO would work, too? Update: no, there is no process | |
372 for stdin/out. | |
373 | |
374 (Done. Added add/delete_keyboard_wait_descriptor to | |
375 term_init/delete_tty. The hint was right, in a way.) | |
376 | |
377 -- Issue with SIGIO: it needs to be disabled during redisplay. See if | |
378 fcntl() kernel behaviour could be emulated by emacsclient. | |
379 | |
380 (Done. Simply disabled the SIGIO emulation hack in emacsclient.) | |
381 (Update: it was added back.) | |
382 | |
383 -- server.el: There are issues with saving files in buffers of closed | |
384 clients. Try editing a file with emacsclient -f, and (without | |
385 saving it) do a delete-frame. The frame is closed without | |
386 question, and a surprising confirmation prompt appears in another | |
387 frame. | |
388 | |
389 (Done. delete-frame now asks for confirmation if it still has | |
390 pending buffers, and modified buffers don't seem to be deleted.) | |
391 | |
392 -- emacsclient.el, server.el: Handle eval or file open errors when | |
393 doing -t. | |
394 | |
395 (Done.) | |
396 | |
397 -- Make parts of struct tty_output accessible from Lisp. The device | |
398 name and the type is sufficient. | |
399 | |
400 (Done, see frame-tty-name and frame-tty-type.) | |
401 | |
402 -- Export delete_tty to the Lisp environment, for emacsclient. | |
403 | |
404 (Done, see delete-tty.) | |
405 | |
406 -- Get rid of the accessor macros in termchar.h, or define macros for | |
407 all members. | |
408 | |
409 (Done.) | |
410 | |
411 -- Move device-specific parameters (like costs) commonly used by | |
412 device backends to a common, device-dependent structure. | |
413 | |
414 (Done. See struct display_method in termhooks.h.) | |
415 | |
416 -- Fix X support. | |
417 | |
418 (Done. Well, it seems to be working.) | |
419 | |
420 -- Allow simultaneous X and tty frames. (Handling input could be | |
421 tricky. Or maybe not.) | |
422 | |
423 (Done. Allowed, that is. It is currently extremely unstable, to | |
424 the point of being unusable. The rif variable causes constant | |
425 core dumps. Handling input is indeed tricky.) | |
426 | |
427 -- Rewrite multi-tty input in terms of MULTI_KBOARD. | |
428 | |
429 (Done. In fact, there was no need to rewrite anything, I just | |
430 added a kboard member to tty_display_info, and initialized the | |
431 frame's kboard from there.) | |
432 | |
390 ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d | 433 ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d |