summaryrefslogtreecommitdiff
path: root/lisp/server.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-04-20 18:04:19 +0800
committerChong Yidong <cyd@gnu.org>2012-04-20 18:04:19 +0800
commitde6ff46dce80a715d46c34ff46f01a28afb63db9 (patch)
tree2c75ba401e4b3bbc3079eddedac99ffaac083e54 /lisp/server.el
parentc07a4c0b599e0debfb10acdf02ac6559b998a88a (diff)
downloademacs-de6ff46dce80a715d46c34ff46f01a28afb63db9.tar.gz
* lisp/server.el (server-execute): Respect initial-buffer-choice
if it is a string and there are no files to open. (server-create-window-system-frame, server-create-tty-frame): Don't switch buffers here. Fixes: debbugs:2825
Diffstat (limited to 'lisp/server.el')
-rw-r--r--lisp/server.el20
1 files changed, 9 insertions, 11 deletions
diff --git a/lisp/server.el b/lisp/server.el
index 123fea3743a..f9c8ea5c577 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -821,10 +821,6 @@ This handles splitting the command if it would be bigger than
(select-frame frame)
(process-put proc 'frame frame)
(process-put proc 'terminal (frame-terminal frame))
-
- ;; Display *scratch* by default.
- (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
-
frame))
(defun server-create-window-system-frame (display nowait proc parent-id
@@ -857,9 +853,6 @@ This handles splitting the command if it would be bigger than
(select-frame frame)
(process-put proc 'frame frame)
(process-put proc 'terminal (frame-terminal frame))
-
- ;; Display *scratch* by default.
- (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
frame)))
(defun server-goto-toplevel (proc)
@@ -1230,12 +1223,17 @@ The following commands are accepted by the client:
;; including code that needs to wait.
(with-local-quit
(condition-case err
- (let* ((buffers
- (when files
- (server-visit-files files proc nowait))))
-
+ (let ((buffers (server-visit-files files proc nowait)))
(mapc 'funcall (nreverse commands))
+ ;; If we were told only to open a new client, obey
+ ;; `initial-buffer-choice' if it specifies a file.
+ (unless (or files commands)
+ (if (stringp initial-buffer-choice)
+ (find-file initial-buffer-choice)
+ (switch-to-buffer (get-buffer-create "*scratch*")
+ 'norecord)))
+
;; Delete the client if necessary.
(cond
(nowait