aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-04-20 18:04:19 +0800
committerChong Yidong2012-04-20 18:04:19 +0800
commitde6ff46dce80a715d46c34ff46f01a28afb63db9 (patch)
tree2c75ba401e4b3bbc3079eddedac99ffaac083e54
parentc07a4c0b599e0debfb10acdf02ac6559b998a88a (diff)
downloademacs-de6ff46dce80a715d46c34ff46f01a28afb63db9.tar.gz
emacs-de6ff46dce80a715d46c34ff46f01a28afb63db9.zip
* 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
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/server.el20
3 files changed, 20 insertions, 11 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 16b9f75c503..b2c487ba15b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -53,6 +53,10 @@ automatically when setting `imagemagick-types-inhibit'.
53*** Setting `imagemagick-types-inhibit' to t now disables the use of 53*** Setting `imagemagick-types-inhibit' to t now disables the use of
54ImageMagick to view images, set 54ImageMagick to view images, set
55 55
56** String values for `initial-buffer-choice' also apply to emacsclient
57frames, if emacsclient is only told to open a new frame without
58specifying any file to visit or expression to evaluate.
59
56 60
57* Editing Changes in Emacs 24.2 61* Editing Changes in Emacs 24.2
58 62
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c9cece95445..947ae6f17f6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12012-04-20 Chong Yidong <cyd@gnu.org>
2
3 * server.el (server-execute): Respect initial-buffer-choice if it
4 is a string and there are no files to open (Bug#2825).
5 (server-create-window-system-frame, server-create-tty-frame):
6 Don't switch buffers here.
7
12012-04-20 Dan Nicolaescu <dann@gnu.org> 82012-04-20 Dan Nicolaescu <dann@gnu.org>
2 9
3 * battery.el (battery-echo-area-format): Display remaining time 10 * battery.el (battery-echo-area-format): Display remaining time
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
821 (select-frame frame) 821 (select-frame frame)
822 (process-put proc 'frame frame) 822 (process-put proc 'frame frame)
823 (process-put proc 'terminal (frame-terminal frame)) 823 (process-put proc 'terminal (frame-terminal frame))
824
825 ;; Display *scratch* by default.
826 (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
827
828 frame)) 824 frame))
829 825
830(defun server-create-window-system-frame (display nowait proc parent-id 826(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
857 (select-frame frame) 853 (select-frame frame)
858 (process-put proc 'frame frame) 854 (process-put proc 'frame frame)
859 (process-put proc 'terminal (frame-terminal frame)) 855 (process-put proc 'terminal (frame-terminal frame))
860
861 ;; Display *scratch* by default.
862 (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
863 frame))) 856 frame)))
864 857
865(defun server-goto-toplevel (proc) 858(defun server-goto-toplevel (proc)
@@ -1230,12 +1223,17 @@ The following commands are accepted by the client:
1230 ;; including code that needs to wait. 1223 ;; including code that needs to wait.
1231 (with-local-quit 1224 (with-local-quit
1232 (condition-case err 1225 (condition-case err
1233 (let* ((buffers 1226 (let ((buffers (server-visit-files files proc nowait)))
1234 (when files
1235 (server-visit-files files proc nowait))))
1236
1237 (mapc 'funcall (nreverse commands)) 1227 (mapc 'funcall (nreverse commands))
1238 1228
1229 ;; If we were told only to open a new client, obey
1230 ;; `initial-buffer-choice' if it specifies a file.
1231 (unless (or files commands)
1232 (if (stringp initial-buffer-choice)
1233 (find-file initial-buffer-choice)
1234 (switch-to-buffer (get-buffer-create "*scratch*")
1235 'norecord)))
1236
1239 ;; Delete the client if necessary. 1237 ;; Delete the client if necessary.
1240 (cond 1238 (cond
1241 (nowait 1239 (nowait