diff options
| author | Martin Rudalics | 2011-09-30 15:21:29 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-09-30 15:21:29 +0200 |
| commit | 199e4c7e5d116a37d76698f611133aa84fcbac63 (patch) | |
| tree | 8b3d9f6221a088542c4d92aad22a2205d68d80e9 | |
| parent | 9ceebf39d984e4415dbb9ae62e883902051257c8 (diff) | |
| download | emacs-199e4c7e5d116a37d76698f611133aa84fcbac63.tar.gz emacs-199e4c7e5d116a37d76698f611133aa84fcbac63.zip | |
Insert initial-scratch-message before displaying *scratch*. (Bug#9636)
* startup.el (command-line-1): Fix last fix by inserting
initial-scratch-message into *scratch* before displaying it.
(Bug#9626) and (Bug#9636)
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/startup.el | 21 |
2 files changed, 18 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42bd14094ba..13efd17cfac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-09-30 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * startup.el (command-line-1): Fix last fix by inserting | ||
| 4 | initial-scratch-message into *scratch* before displaying it. | ||
| 5 | (Bug#9626) and (Bug#9636) | ||
| 6 | |||
| 1 | 2011-09-29 Eli Zaretskii <eliz@gnu.org> | 7 | 2011-09-29 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * simple.el (line-move): If auto-hscroll-mode is disabled and the | 9 | * simple.el (line-move): If auto-hscroll-mode is disabled and the |
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." | |||
| 2307 | ;; abort later. | 2307 | ;; abort later. |
| 2308 | (unless (frame-live-p (selected-frame)) (kill-emacs nil)))))) | 2308 | (unless (frame-live-p (selected-frame)) (kill-emacs nil)))))) |
| 2309 | 2309 | ||
| 2310 | (when initial-buffer-choice | 2310 | (when (eq initial-buffer-choice t) |
| 2311 | (cond ((eq initial-buffer-choice t) | 2311 | ;; When initial-buffer-choice equals t make sure that *scratch* |
| 2312 | (switch-to-buffer (get-buffer-create "*scratch*"))) | 2312 | ;; exists. |
| 2313 | ((stringp initial-buffer-choice) | 2313 | (get-buffer-create "*scratch*")) |
| 2314 | (find-file initial-buffer-choice)))) | ||
| 2315 | 2314 | ||
| 2316 | ;; If *scratch* exists and is empty, insert initial-scratch-message. | 2315 | ;; If *scratch* exists and is empty, insert initial-scratch-message. |
| 2316 | ;; Do this before switching to *scratch* below to handle bug#9605. | ||
| 2317 | (and initial-scratch-message | 2317 | (and initial-scratch-message |
| 2318 | (get-buffer "*scratch*") | 2318 | (get-buffer "*scratch*") |
| 2319 | (with-current-buffer "*scratch*" | 2319 | (with-current-buffer "*scratch*" |
| 2320 | (when (zerop (buffer-size)) | 2320 | (when (zerop (buffer-size)) |
| 2321 | ;; Insert before markers to make sure that window-point | 2321 | (insert initial-scratch-message) |
| 2322 | ;; appears at end of buffer when *scratch* is displayed | ||
| 2323 | ;; (Bug#9605). | ||
| 2324 | (insert-before-markers initial-scratch-message) | ||
| 2325 | (set-buffer-modified-p nil)))) | 2322 | (set-buffer-modified-p nil)))) |
| 2326 | 2323 | ||
| 2324 | (when initial-buffer-choice | ||
| 2325 | (cond ((eq initial-buffer-choice t) | ||
| 2326 | (switch-to-buffer (get-buffer-create "*scratch*"))) | ||
| 2327 | ((stringp initial-buffer-choice) | ||
| 2328 | (find-file initial-buffer-choice)))) | ||
| 2329 | |||
| 2327 | (if (or inhibit-startup-screen | 2330 | (if (or inhibit-startup-screen |
| 2328 | initial-buffer-choice | 2331 | initial-buffer-choice |
| 2329 | noninteractive | 2332 | noninteractive |