]> git.eshelyaron.com Git - emacs.git/commitdiff
(server-buffer-done): Avoid changing the buffer when deleting the
authorChong Yidong <cyd@stupidchicken.com>
Wed, 24 Sep 2008 20:12:02 +0000 (20:12 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 24 Sep 2008 20:12:02 +0000 (20:12 +0000)
client's frame (bug#640).

lisp/server.el

index 0a8df5d9f47b371f5a37b434b3172d7b0d8ef9b9..8dfa6d19732f4efdf9915848edc943c57688797d 100644 (file)
@@ -1084,7 +1084,13 @@ FOR-KILLING if non-nil indicates that we are called from `kill-buffer'."
          ;; tell it that it is done, and forget it entirely.
          (unless buffers
            (server-log "Close" proc)
-           (server-delete-client proc)))))
+           (if for-killing
+               ;; `server-delete-client' might delete the client's
+               ;; frames, which might change the current buffer.  We
+               ;; don't want that (bug#640).
+               (save-current-buffer
+                 (server-delete-client proc))
+             (server-delete-client proc))))))
     (when (and (bufferp buffer) (buffer-name buffer))
       ;; We may or may not kill this buffer;
       ;; if we do, do not call server-buffer-done recursively