Subject: bug#29999: `initial-buffer-choice' function can result in duplicate buffer display

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 17 Apr 2018 23:55:47 +0200

David Beswick <[email-masked]> writes:

> Hello, just a minor bug relating to the behaviour of startup.el's
> `command-line-1' and the `initial-buffer-choice' variable. When an
> `initial-buffer-choice' function returns the head of the
> `displayable-buffers' list in `command-line-1' then Emacs starts with
> that same buffer visited in two windows. I would expect it should only
> be shown in a single window.
>
> To be concrete, I ran into this behavior as on startup I wanted to
> display a particular buffer that I create except when a file is given
> on the command line. In that case I want to visit the given file
> instead.
>
> The behavior can be reproduced by creating a file `bug-init.el':

Thanks; I've applied your patch to Emacs 27.1.

But a note about the patch: It had been mangled by your mailer (all the
spaces had been turned into non-breaking space), so I had to do it by
hand, but hopefully I got it right.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no