diff options
| author | Sean Whitton | 2022-05-03 18:08:14 -0700 |
|---|---|---|
| committer | Sean Whitton | 2022-05-03 18:09:01 -0700 |
| commit | f2d2fe6fc8ef0b6087c4a8a69d05a4e521b23047 (patch) | |
| tree | 3e9fdb9da8fa36ccde6f739de3427a87a90c645f /lisp/server.el | |
| parent | 185c2f1904c457ad043fe28cca915f508569c54a (diff) | |
| download | emacs-f2d2fe6fc8ef0b6087c4a8a69d05a4e521b23047.tar.gz emacs-f2d2fe6fc8ef0b6087c4a8a69d05a4e521b23047.zip | |
server-execute: Initialize the *scratch* buffer
* lisp/server.el: Require subr-x when compiling.
(server-execute): Initialize the *scratch* buffer in the same way that
the scratch-buffer command does, for consistency.
Diffstat (limited to 'lisp/server.el')
| -rw-r--r-- | lisp/server.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/server.el b/lisp/server.el index 763cf27f7ac..fc6991df5f1 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -82,7 +82,9 @@ | |||
| 82 | 82 | ||
| 83 | ;;; Code: | 83 | ;;; Code: |
| 84 | 84 | ||
| 85 | (eval-when-compile (require 'cl-lib)) | 85 | (eval-when-compile |
| 86 | (require 'cl-lib) | ||
| 87 | (require 'subr-x)) | ||
| 86 | 88 | ||
| 87 | (defgroup server nil | 89 | (defgroup server nil |
| 88 | "Emacs running as a server process." | 90 | "Emacs running as a server process." |
| @@ -1366,9 +1368,14 @@ The following commands are accepted by the client: | |||
| 1366 | (find-file-noselect initial-buffer-choice)) | 1368 | (find-file-noselect initial-buffer-choice)) |
| 1367 | ((functionp initial-buffer-choice) | 1369 | ((functionp initial-buffer-choice) |
| 1368 | (funcall initial-buffer-choice))))) | 1370 | (funcall initial-buffer-choice))))) |
| 1369 | (switch-to-buffer | 1371 | (if (buffer-live-p buf) |
| 1370 | (if (buffer-live-p buf) buf (get-buffer-create "*scratch*")) | 1372 | (switch-to-buffer buf 'norecord) |
| 1371 | 'norecord))) | 1373 | (if-let ((scratch (get-buffer "*scratch*"))) |
| 1374 | (switch-to-buffer scratch 'norecord) | ||
| 1375 | (switch-to-buffer (get-buffer-create "*scratch*") 'norecord) | ||
| 1376 | (when initial-scratch-message | ||
| 1377 | (insert initial-scratch-message)) | ||
| 1378 | (funcall initial-major-mode))))) | ||
| 1372 | 1379 | ||
| 1373 | ;; Delete the client if necessary. | 1380 | ;; Delete the client if necessary. |
| 1374 | (cond | 1381 | (cond |