diff options
| author | Constantin Kulikov | 2012-12-24 18:49:19 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2012-12-24 18:49:19 +0100 |
| commit | dc646358274fbfdab6ef3dfb7717bc4a52f607f3 (patch) | |
| tree | 71e4f0d5881561ae18ee4a856ba8a2dd9d84f3a0 /lisp/server.el | |
| parent | c1860cdc02404d84e7f29d206b799031190a794e (diff) | |
| download | emacs-dc646358274fbfdab6ef3dfb7717bc4a52f607f3.tar.gz emacs-dc646358274fbfdab6ef3dfb7717bc4a52f607f3.zip | |
Allow function as value of initial-buffer-choice (Bug#13251).
* startup.el (initial-buffer-choice): Allow function as value
(Bug#13251).
(command-line-1): Handle case where initial-buffer-choice
specifies a function.
* server.el (server-execute): Handle case where
initial-buffer-choice specifies a function.
Diffstat (limited to 'lisp/server.el')
| -rw-r--r-- | lisp/server.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/server.el b/lisp/server.el index c78e3e376aa..59f75722ccb 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -1256,12 +1256,17 @@ The following commands are accepted by the client: | |||
| 1256 | (mapc 'funcall (nreverse commands)) | 1256 | (mapc 'funcall (nreverse commands)) |
| 1257 | 1257 | ||
| 1258 | ;; If we were told only to open a new client, obey | 1258 | ;; If we were told only to open a new client, obey |
| 1259 | ;; `initial-buffer-choice' if it specifies a file. | 1259 | ;; `initial-buffer-choice' if it specifies a file |
| 1260 | (unless (or files commands) | 1260 | ;; or a function. |
| 1261 | (if (stringp initial-buffer-choice) | 1261 | (unless (or files commands) |
| 1262 | (find-file initial-buffer-choice) | 1262 | (let ((buf |
| 1263 | (switch-to-buffer (get-buffer-create "*scratch*") | 1263 | (cond ((stringp initial-buffer-choice) |
| 1264 | 'norecord))) | 1264 | (find-file-noselect initial-buffer-choice)) |
| 1265 | ((functionp initial-buffer-choice) | ||
| 1266 | (funcall initial-buffer-choice))))) | ||
| 1267 | (switch-to-buffer | ||
| 1268 | (if (buffer-live-p buf) buf (get-buffer-create "*scratch*")) | ||
| 1269 | 'norecord))) | ||
| 1265 | 1270 | ||
| 1266 | ;; Delete the client if necessary. | 1271 | ;; Delete the client if necessary. |
| 1267 | (cond | 1272 | (cond |