(Done.)
+-- C-g should work on secondary terminals.
+
+ (Done, but the binding is not configurable.)
+
+-- Deal with SIGHUP in Emacs and in emacsclient. (After this, the
+ server-frames may be removed from server.el.)
+
+ (Done, nothing to do. It seems that Emacs does not receive SIGHUP
+ from secondary ttys.)
+
+-- Change emacsclient/server.el to support the -h argument better,
+ i.e. automatically close the socket when the frame is closed.
+
+ (Seems to be working OK.)
+
THINGS TO DO
------------
Update: yes it does, although it is much rarer. Or maybe it's
another bug.
-** Change emacsclient/server.el to support the -h argument better,
- i.e. automatically close the socket when the frame is closed.
+** Make parts of struct tty_output accessible from Lisp. The device
+ name and the type is sufficient.
** Export delete_tty to the Lisp environment, for emacsclient.
-** C-g should work on secondary terminals.
-
-** Make parts of struct tty_output accessible from Lisp. The device
- name and the type is sufficient.
+** Make sure C-g goes to the right frame. This is hard, as SIGINT
+ doesn't have a tty parameter. :-(
** Find out why does Emacs abort when it wants to close its
controlling tty. Hint: chan_process[] array. Hey, maybe
** Find out the best way to support suspending Emacs with multiple
ttys.
-** Deal with SIGHUP in Emacs and in emacsclient. (After this, the
- server-frames may be removed from server.el.)
-
** Do tty output through term_hooks, like all other display backends.
** Fix X support.
;; Remove PROC from the list of clients.
(when client
(setq server-clients (delq client server-clients))
- (setq server-frames (delq client server-frames))
+ (let ((frame (assq (car client) server-frames)))
+ (setq server-frames (delq frame server-frames))
+ (when (frame-live-p (cadr frame)) (delete-frame (cadr frame))))
(dolist (buf (cdr client))
(with-current-buffer buf
;; Remove PROC from the clients of each buffer.
(if (null (cdr client))
;; This client is empty; get rid of it immediately.
(progn
- (let ((frame (cadr (assq (car client) server-frames))))
- ;; Close the client's frame.
- (when frame (delete-frame frame)))
+ (let ((frame (assq (car client) server-frames)))
+ (setq server-frames (delq frame server-frames))
+ (when (frame-live-p (cadr frame)) (delete-frame (cadr frame))))
(delete-process proc)
(server-log "Close empty client" proc))
;; We visited some buffer for this client.
;; If client now has no pending buffers,
;; tell it that it is done, and forget it entirely.
(unless (cdr client)
- (let ((frame (cadr (assq (car client) server-frames))))
- ;; Close the client's frame.
- (when frame (delete-frame frame)))
+ (let ((frame (assq (car client) server-frames)))
+ (setq server-frames (delq frame server-frames))
+ (when (frame-live-p (cadr frame)) (delete-frame (cadr frame))))
(delete-process (car client))
(server-log "Close" (car client))
(setq server-clients (delq client server-clients))))
{
if (TTY_TERMSCRIPT (current_tty))
putc (c & 0177, TTY_TERMSCRIPT (current_tty));
- putc (c & 0177, TTY_OUTPUT (current_tty));
+ if (putc (c & 0177, TTY_OUTPUT (current_tty)) == EOF)
+ abort (); /* XXX For testing only! */
return c;
}
if (! tty_list->next)
kill (0, SIGHUP); /* This was the last terminal. */
else
- ; /* XXX tty should be closed here. */
+ delete_tty (tty); /* XXX I wonder if this is safe here. */
}
#if defined (AIX) && (! defined (aix386) && defined (_BSD))
/* The kernel sometimes fails to deliver SIGHUP for ptys.
if (! tty_list->next)
kill (0, SIGHUP); /* This was the last terminal. */
else
- ; /* XXX tty should be closed here. */
+ delete_tty (tty); /* XXX I wonder if this is safe here. */
}
#endif
}