diff options
| -rw-r--r-- | lisp/startup.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 1faeabf23b8..f6907a821b9 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -2504,7 +2504,12 @@ nil default-directory" name) | |||
| 2504 | (insert (substitute-command-keys initial-scratch-message)) | 2504 | (insert (substitute-command-keys initial-scratch-message)) |
| 2505 | (set-buffer-modified-p nil)))) | 2505 | (set-buffer-modified-p nil)))) |
| 2506 | 2506 | ||
| 2507 | ;; Prepend `initial-buffer-choice' to `displayable-buffers'. | 2507 | ;; Prepend `initial-buffer-choice' to `displayable-buffers'. If |
| 2508 | ;; the buffer is already a member of that list then shift the | ||
| 2509 | ;; buffer to the head of the list. The shift behavior is intended | ||
| 2510 | ;; to prevent the same buffer being displayed in two windows when | ||
| 2511 | ;; an `initial-buffer-choice' function happens to return the head | ||
| 2512 | ;; of `displayable-buffers'. | ||
| 2508 | (when initial-buffer-choice | 2513 | (when initial-buffer-choice |
| 2509 | (let ((buf | 2514 | (let ((buf |
| 2510 | (cond ((stringp initial-buffer-choice) | 2515 | (cond ((stringp initial-buffer-choice) |
| @@ -2517,7 +2522,7 @@ nil default-directory" name) | |||
| 2517 | (error "initial-buffer-choice must be a string, a function, or t."))))) | 2522 | (error "initial-buffer-choice must be a string, a function, or t."))))) |
| 2518 | (unless (buffer-live-p buf) | 2523 | (unless (buffer-live-p buf) |
| 2519 | (error "initial-buffer-choice is not a live buffer.")) | 2524 | (error "initial-buffer-choice is not a live buffer.")) |
| 2520 | (setq displayable-buffers (cons buf displayable-buffers)))) | 2525 | (setq displayable-buffers (cons buf (delq buf displayable-buffers))))) |
| 2521 | 2526 | ||
| 2522 | ;; Display the first two buffers in `displayable-buffers'. If | 2527 | ;; Display the first two buffers in `displayable-buffers'. If |
| 2523 | ;; `initial-buffer-choice' is non-nil, its buffer will be the | 2528 | ;; `initial-buffer-choice' is non-nil, its buffer will be the |