Commit 22de1e79 authored by Karoly Lorentey's avatar Karoly Lorentey

Delete server frames on server restart.

lisp/server.el (server-start): Delete any remaining opened frames of
the previous server.
(server-sentinel, server-process-filter): Force deleting the frame.
(server-buffer-done): Ditto.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-25
parent 7c3a2615
......@@ -248,22 +248,10 @@ THINGS TO DO
Update: Some of these errors may have been caused by having more
file handles than FD_SETSIZE.
** 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.
** 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
noninterrupt-IO would work, too?
** Implement support for starting an interactive Emacs session without
an initial frame. (The user would connect to it and open frames
later, with emacsclient.) Not necessarily a good idea.
** Support raw secondary terminals. (Note that SIGIO works only on
the controlling terminal.) Hint: extend read_input_waiting() for
multiple ttys and hopefully this will be fixed.
......@@ -274,6 +262,18 @@ THINGS TO DO
** Issue with SIGIO: it needs to be disabled during redisplay. See if
fcntl() kernel behaviour could be emulated by emacsclient.
** 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.
** Make sure C-g goes to the right frame. This is hard, as SIGINT
doesn't have a tty parameter. :-(
** Implement support for starting an interactive Emacs session without
an initial frame. (The user would connect to it and open frames
later, with emacsclient.) Not necessarily a good idea.
** Move optimalization parameters (costs) from union output_data to
a backend-neutral per-device structure.
......
......@@ -187,7 +187,7 @@ are done with it in the server.")
(setq server-clients (delq client server-clients))
(let ((frame (assq (car client) server-frames)))
(setq server-frames (delq frame server-frames))
(when (frame-live-p (cadr frame)) (delete-frame (cadr frame))))
(when (frame-live-p (cadr frame)) (delete-frame (cadr frame) 'force)))
(dolist (buf (cdr client))
(with-current-buffer buf
;; Remove PROC from the clients of each buffer.
......@@ -267,6 +267,11 @@ Prefix arg means just kill any existing server communications subprocess."
(while server-clients
(let ((buffer (nth 1 (car server-clients))))
(server-buffer-done buffer)))
;; Delete any remaining opened frames of the previous server.
(while server-frames
(let ((frame (cadar server-frames)))
(setq server-frames (cdr server-frames))
(when frame-live-p frame (delete-frame frame 'force))))
(unless leave-dead
(if server-process
(server-log (message "Restarting server")))
......@@ -382,7 +387,7 @@ PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"."
(progn
(let ((frame (assq (car client) server-frames)))
(setq server-frames (delq frame server-frames))
(when (frame-live-p (cadr frame)) (delete-frame (cadr frame))))
(when (frame-live-p (cadr frame)) (delete-frame (cadr frame) 'force)))
(delete-process proc)
(server-log "Close empty client" proc))
;; We visited some buffer for this client.
......@@ -471,7 +476,7 @@ FOR-KILLING if non-nil indicates that we are called from `kill-buffer'."
(unless (cdr client)
(let ((frame (assq (car client) server-frames)))
(setq server-frames (delq frame server-frames))
(when (frame-live-p (cadr frame)) (delete-frame (cadr frame))))
(when (frame-live-p (cadr frame)) (delete-frame (cadr frame) 'force)))
(delete-process (car client))
(server-log "Close" (car client))
(setq server-clients (delq client server-clients))))
......
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