changeset 82985:8d7be2534cbc

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
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 30 Dec 2003 17:42:02 +0000
parents 3b1f99f17618
children 02a346f99eaf
files README.multi-tty lisp/server.el
diffstat 2 files changed, 20 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/README.multi-tty	Tue Dec 30 17:05:05 2003 +0000
+++ b/README.multi-tty	Tue Dec 30 17:42:02 2003 +0000
@@ -248,22 +248,10 @@
    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 @@
 ** 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.
 
--- a/lisp/server.el	Tue Dec 30 17:05:05 2003 +0000
+++ b/lisp/server.el	Tue Dec 30 17:42:02 2003 +0000
@@ -187,7 +187,7 @@
       (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 @@
   (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 @@
 	  (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 @@
 	(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))))