diff options
Diffstat (limited to 'lisp/startup.el')
-rw-r--r-- | lisp/startup.el | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 4e6f0af0368..16cf41506bd 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2307,23 +2307,26 @@ A fancy display is used on graphic displays, normal otherwise." ;; abort later. (unless (frame-live-p (selected-frame)) (kill-emacs nil)))))) - (when initial-buffer-choice - (cond ((eq initial-buffer-choice t) - (switch-to-buffer (get-buffer-create "*scratch*"))) - ((stringp initial-buffer-choice) - (find-file initial-buffer-choice)))) + (when (eq initial-buffer-choice t) + ;; When initial-buffer-choice equals t make sure that *scratch* + ;; exists. + (get-buffer-create "*scratch*")) ;; If *scratch* exists and is empty, insert initial-scratch-message. + ;; Do this before switching to *scratch* below to handle bug#9605. (and initial-scratch-message (get-buffer "*scratch*") (with-current-buffer "*scratch*" (when (zerop (buffer-size)) - ;; Insert before markers to make sure that window-point - ;; appears at end of buffer when *scratch* is displayed - ;; (Bug#9605). - (insert-before-markers initial-scratch-message) + (insert initial-scratch-message) (set-buffer-modified-p nil)))) + (when initial-buffer-choice + (cond ((eq initial-buffer-choice t) + (switch-to-buffer (get-buffer-create "*scratch*"))) + ((stringp initial-buffer-choice) + (find-file initial-buffer-choice)))) + (if (or inhibit-startup-screen initial-buffer-choice noninteractive |