changeset 25272:db26c1e76313

(server-process-filter): If a client visits no buffers, close it immediately before recording it.
author Karl Heuer <kwzh@gnu.org>
date Mon, 16 Aug 1999 03:15:11 +0000
parents 0d9fd0e4f7a3
children c8d2d5e80cc0
files lisp/server.el
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Mon Aug 16 03:14:25 1999 +0000
+++ b/lisp/server.el	Mon Aug 16 03:15:11 1999 +0000
@@ -258,12 +258,19 @@
 		      (setq lineno 1)))))
 	      (server-visit-files files client nowait)
 	      ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
-	      (or nowait
-		  (setq server-clients (cons client server-clients)))
-	      (server-switch-buffer (nth 1 client))
-	      (run-hooks 'server-switch-hook)
-	      (message (substitute-command-keys
-			"When done with a buffer, type \\[server-edit]")))))))
+	      (if (null (cdr client))
+		  ;; This client is empty; get rid of it immediately.
+		  (progn
+		    (send-string server-process 
+				 (format "Close: %s Done\n" (car client)))
+		    (server-log (format "Close empty client: %s Done\n" (car client))))
+		;; We visited some buffer for this client.
+		(or nowait
+		    (setq server-clients (cons client server-clients)))
+		(server-switch-buffer (nth 1 client))
+		(run-hooks 'server-switch-hook)
+		(message (substitute-command-keys
+			  "When done with a buffer, type \\[server-edit]"))))))))
   ;; Save for later any partial line that remains.
   (setq server-previous-string string))