bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21505: 24.4; Buffer order


From: Eli Zaretskii
Subject: bug#21505: 24.4; Buffer order
Date: Sun, 20 Feb 2022 15:20:27 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Tassilo Horn <tsdh@gnu.org>,  Eli Zaretskii <eliz@gnu.org>,
>   travis.hoppe@gmail.com,  21505@debbugs.gnu.org
> Date: Sun, 20 Feb 2022 13:57:03 +0100
> 
> But I'm wondering -- why is Emacs popping up a *Buffer List* window when
> you ask it to open two files?

It doesn't.  It only shows *Buffer List* when you as it to visit 3 or
more files.  This is explicitly coded in command-line-1:

    ;; Display the first two buffers in `displayable-buffers'.  If
    ;; `initial-buffer-choice' is non-nil, its buffer will be the
    ;; first buffer in `displayable-buffers'.  The first buffer will
    ;; be focused.
    (let ((displayable-buffers-len (length displayable-buffers))
          ;; `nondisplayed-buffers-p' is true if there exist buffers
          ;; in `displayable-buffers' that were not displayed to the
          ;; user.
          (nondisplayed-buffers-p nil))
      (when (> displayable-buffers-len 0)
        (switch-to-buffer (car displayable-buffers)))
      (when (> displayable-buffers-len 1)
        (switch-to-buffer-other-window (car (cdr displayable-buffers)))
        ;; Focus on the first buffer.
        (other-window -1))
      (when (> displayable-buffers-len 2)  <<<<<<<<<<<<<<<<<<<<<<<<<<<<
        (setq nondisplayed-buffers-p t))

> I'd have thought the obvious thing to do in this situation is to
> open as many windows as there are files (if possible)?

I guess the rationale is that with too many files visited we cannot be
sure which of them the user would like to see first, and we don't want
to show them all, lest the windows become too small.

> Or open a single window displaying the first file specified
> (and then have the rest be in the next-buffer order you describe).

That'd be less useful than what we do now with 2 files, IMO.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]