diff options
| author | David Beswick | 2018-04-17 23:53:55 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2018-04-17 23:54:14 +0200 |
| commit | 2e54ffebb8555d23f72c7b450b481f0335562b0d (patch) | |
| tree | a757dd55fc5154275ec5d9c43baa18f5955e833e | |
| parent | d2d1f39536e32dc6789ee2d26aeda05a405d47d3 (diff) | |
| download | emacs-2e54ffebb8555d23f72c7b450b481f0335562b0d.tar.gz emacs-2e54ffebb8555d23f72c7b450b481f0335562b0d.zip | |
Don't display an initial-buffer-choice buffer twice
* lisp/startup.el (command-line-1): Don't display an
initial-buffer-choice buffer twice if the user is also explicitly
specifying it on the mode line, but shift it to the initial place
(bug#29999).
Copyright-paperwork-exempt: yes
| -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 |