From 0c40a645afdfb57feefe2f6595c8dd90d2d79682 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Mon, 16 Aug 1999 03:15:11 +0000 Subject: [PATCH] (server-process-filter): If a client visits no buffers, close it immediately before recording it. --- lisp/server.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/server.el b/lisp/server.el index 89e3710b329..4a133f529c0 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -258,12 +258,19 @@ Prefix arg means just kill any existing server communications subprocess." (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)) -- 2.39.5