changeset 83109:1707638677c9

Fix one more case of the previous error. lisp/server.el (server-delete-client): Added noframe parameter. (server-handle-delete-frame): Use it. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-149
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 19 Apr 2004 14:21:37 +0000
parents c7a76f7d323c
children 43581c3f182f
files lisp/server.el
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Mon Apr 19 14:16:10 2004 +0000
+++ b/lisp/server.el	Mon Apr 19 14:21:37 2004 +0000
@@ -207,8 +207,10 @@
     (setq server-clients (cons (cons proc nil)
 			       server-clients))))
 
-(defun server-delete-client (client)
-  "Delete CLIENT, including its buffers, displays and frames."
+(defun server-delete-client (client &optional noframe)
+  "Delete CLIENT, including its buffers, displays and frames.
+If NOFRAME is non-nil, let the frames live.  (To be used from
+`delete-frame-functions'."
   ;; Force a new lookup of client (prevents infinite recursion).
   (setq client (server-client
 		(if (listp client) (car client) client)))
@@ -235,10 +237,11 @@
 	  (delete-tty tty)))
 
       ;; Delete the client's frames.
-      (dolist (frame (frame-list))
-	(if (and (frame-live-p frame)
-		 (equal (car client) (frame-parameter frame 'client)))
-	    (delete-frame frame)))
+      (unless noframe
+	(dolist (frame (frame-list))
+	  (if (and (frame-live-p frame)
+		   (equal (car client) (frame-parameter frame 'client)))
+	      (delete-frame frame))))
 
       ;; Delete the client's process.
       (if (eq (process-status (car client)) 'open)
@@ -285,7 +288,7 @@
       ;; (Closing a terminal frame must not trigger a delete;
       ;; we must wait for delete-tty-after-functions.)
       (server-log (format "server-handle-delete-frame, frame %s" frame) proc)
-      (server-delete-client proc))))
+      (server-delete-client proc 'noframe)))) ; Let delete-frame delete the frame later.
 
 (defun server-handle-suspend-tty (tty)
   "Notify the emacsclient process to suspend itself when its tty device is suspended."