GNU bug report logs - #21505
24.4; Buffer order

Previous Next

Package: emacs;

Reported by: hoppe <travis.hoppe <at> gmail.com>

Date: Thu, 17 Sep 2015 04:57:04 UTC

Severity: wishlist

Tags: confirmed, moreinfo

Found in version 24.4

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21505 in the body.
You can then email your comments to 21505 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 04:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to hoppe <travis.hoppe <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 17 Sep 2015 04:57:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: hoppe <travis.hoppe <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; Buffer order
Date: Wed, 16 Sep 2015 22:57:07 -0400
[Message part 1 (text/plain, inline)]
This is prompted by the Stack Overflow question

http://emacs.stackexchange.com/q/16675/9553

Let's say I have a Linux directory that looks like

    -rw-r--r--  1 hooked se     0 Sep 16 16:02 a
    -rw-r--r--  1 hooked se     0 Sep 16 16:02 b
    -rw-r--r--  1 hooked se     0 Sep 16 16:02 c

When I type emacs * it opens all three files but it puts me in the middle
of the buffer chain. For example when I run it, I start off at c and
NextBuffer takes me along the chain

    c -> b -> *Messages* -> *scratch* -> a ->

This is really, really annoying. I'd like to open up emacs and have the
order be any of the permutations

    c -> b -> a -> *Messages* -> *scratch* ->
    b -> a -> c -> *Messages* -> *scratch* ->
    a -> b -> c -> *Messages* -> *scratch* ->

This behavior is the most natural one IMHO (user @Stefan agrees). This is a
feature request to make this the default behavior.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 05:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: hoppe <travis.hoppe <at> gmail.com>
Cc: 21505 <at> debbugs.gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 08:17:12 +0300
> From: hoppe <travis.hoppe <at> gmail.com>
> Date: Wed, 16 Sep 2015 22:57:07 -0400
> 
> Let's say I have a Linux directory that looks like
> 
> -rw-r--r-- 1 hooked se 0 Sep 16 16:02 a
> -rw-r--r-- 1 hooked se 0 Sep 16 16:02 b
> -rw-r--r-- 1 hooked se 0 Sep 16 16:02 c
> When I type emacs * it opens all three files but it puts me in the middle of
> the buffer chain. For example when I run it, I start off at c and NextBuffer
> takes me along the chain
> 
> c -> b -> *Messages* -> *scratch* -> a ->
> This is really, really annoying. I'd like to open up emacs and have the order
> be any of the permutations
> 
> c -> b -> a -> *Messages* -> *scratch* -> 
> b -> a -> c -> *Messages* -> *scratch* -> 
> a -> b -> c -> *Messages* -> *scratch* -> 
> 
> This behavior is the most natural one IMHO (user @Stefan agrees). This is a
> feature request to make this the default behavior.

Is the feature request to produce the above buffer order only once,
upon entry to Emacs in this scenario, or is it more general,
i.e. should hold at any arbitrary point in time during the Emacs
session?  If the latter, please define the desired buffer order more
generally, since I'm guessing *scratch* and *Messages* are not the
only buffers you dislike.

In any case, the latter possibility is much harder to accomplish; the
former is relatively easy, but I question its usefulness, given that
it's limited to the initial entry.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 06:50:02 GMT) Full text and rfc822 format available.

Message #11 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, hoppe <travis.hoppe <at> gmail.com>
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 08:49:51 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Let's say I have a Linux directory that looks like
>> 
>> -rw-r--r-- 1 hooked se 0 Sep 16 16:02 a
>> -rw-r--r-- 1 hooked se 0 Sep 16 16:02 b
>> -rw-r--r-- 1 hooked se 0 Sep 16 16:02 c
>> When I type emacs * it opens all three files but it puts me in the middle of
>> the buffer chain. For example when I run it, I start off at c and NextBuffer
>> takes me along the chain
>> 
>> c -> b -> *Messages* -> *scratch* -> a ->
>> This is really, really annoying. I'd like to open up emacs and have the order
>> be any of the permutations
>> 
>> c -> b -> a -> *Messages* -> *scratch* -> 
>> b -> a -> c -> *Messages* -> *scratch* -> 
>> a -> b -> c -> *Messages* -> *scratch* -> 
>> 
>> This behavior is the most natural one IMHO (user @Stefan
>> agrees). This is a feature request to make this the default behavior.
>
> Is the feature request to produce the above buffer order only once,
> upon entry to Emacs in this scenario, or is it more general,
> i.e. should hold at any arbitrary point in time during the Emacs
> session? [...]
>
> In any case, the latter possibility is much harder to accomplish; the
> former is relatively easy, but I question its usefulness, given that
> it's limited to the initial entry.

IMO it could and should apply also to emacsclient invocations.  And to
me, the order a, b, c seems to be the only right one.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 06:57:01 GMT) Full text and rfc822 format available.

Message #14 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 09:56:26 +0300
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: hoppe <travis.hoppe <at> gmail.com>,  21505 <at> debbugs.gnu.org
> Date: Thu, 17 Sep 2015 08:49:51 +0200
> 
> And to me, the order a, b, c seems to be the only right one.

You do realize that the command line said just "*", and the order of
the files Emacs saw was determined by the expansion of that wildcard
by the shell, yes?

Or are you saying that the order of the buffers should always be
alphabetical?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 07:54:01 GMT) Full text and rfc822 format available.

Message #17 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 09:53:01 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Tassilo Horn <tsdh <at> gnu.org>
>> Cc: hoppe <travis.hoppe <at> gmail.com>,  21505 <at> debbugs.gnu.org
>> Date: Thu, 17 Sep 2015 08:49:51 +0200
>> 
>> And to me, the order a, b, c seems to be the only right one.
>
> You do realize that the command line said just "*", and the order of
> the files Emacs saw was determined by the expansion of that wildcard
> by the shell, yes?

Yes, I've seen that and I assumed that the usual shell expansion is
alphabetical.

> Or are you saying that the order of the buffers should always be
> alphabetical?

No, it should always be as given to emacs/emacsclient, i.e., when I
invoke

  $ emacsclient x a b

I want to have the buffer x selected and using `next-buffer' I'd switch
to a and then b, and then to the other buffers which have existed
before.  Right now, x will be selected, but a and b are far away.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 12:51:02 GMT) Full text and rfc822 format available.

Message #20 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, travis.hoppe <at> gmail.com, 21505 <at> debbugs.gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 08:50:33 -0400
> No, it should always be as given to emacs/emacsclient, i.e., when I
> invoke
>
>   $ emacsclient x a b
>
> I want to have the buffer x selected and using `next-buffer' I'd switch
> to a and then b, and then to the other buffers which have existed
> before.  Right now, x will be selected, but a and b are far away.

That's right.  And same for "emacs x a b".

The precise behavior is a bit more complex since those commands, rather
than just showing the first file may/will also show the buffer-list,
but if exactly one of the files is shown it should be the first in the
list and next-buffer should go in the order in which the file names
were given (until reaching the end of this list at which point it'll
hit things like *Messages* and friends and that's fine).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 14:56:02 GMT) Full text and rfc822 format available.

Message #23 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com, tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 17:55:17 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  21505 <at> debbugs.gnu.org,  travis.hoppe <at> gmail.com
> Date: Thu, 17 Sep 2015 08:50:33 -0400
> 
> > No, it should always be as given to emacs/emacsclient, i.e., when I
> > invoke
> >
> >   $ emacsclient x a b
> >
> > I want to have the buffer x selected and using `next-buffer' I'd switch
> > to a and then b, and then to the other buffers which have existed
> > before.  Right now, x will be selected, but a and b are far away.
> 
> That's right.  And same for "emacs x a b".
> 
> The precise behavior is a bit more complex since those commands, rather
> than just showing the first file may/will also show the buffer-list,
> but if exactly one of the files is shown it should be the first in the
> list and next-buffer should go in the order in which the file names
> were given (until reaching the end of this list at which point it'll
> hit things like *Messages* and friends and that's fine).

The questions I asked the OP still stand.  The required feature is not
defined in sufficient detail.  If only the initial order is required,
it's probably relatively easy, but then that order is very fragile and
could easily break as soon as the user issues the first command.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 15:01:02 GMT) Full text and rfc822 format available.

Message #26 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: hoppe <travis.hoppe <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 10:59:41 -0400
[Message part 1 (text/plain, inline)]
In response to the first question, I'd like this to be the "easy" request,
that this behavior is only for when emacs opens and not continuously during
the session. I agree, it does not need to be maintained during the session.

Re: Tassilo Horn: I purposely showed my example with a wildcard since emacs
could be given any expansion from the shell. To me it, and for my usual use
case, it doesn't matter. I have a bunch of files I'd like to edit and I
often miss those that are past the messages and scratch buffer. Opening the
files in the order given from the command line seems very natural to me.

So to be clear, given the command run on the shell:

> emacs a c b

The buffer order should be [a,c,b,*messages*,*scratch*]. Currently the
default behavior looks something like [b,c,*messages*,*scratch*, a].

On Thu, Sep 17, 2015 at 10:55 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>,  21505 <at> debbugs.gnu.org,
> travis.hoppe <at> gmail.com
> > Date: Thu, 17 Sep 2015 08:50:33 -0400
> >
> > > No, it should always be as given to emacs/emacsclient, i.e., when I
> > > invoke
> > >
> > >   $ emacsclient x a b
> > >
> > > I want to have the buffer x selected and using `next-buffer' I'd switch
> > > to a and then b, and then to the other buffers which have existed
> > > before.  Right now, x will be selected, but a and b are far away.
> >
> > That's right.  And same for "emacs x a b".
> >
> > The precise behavior is a bit more complex since those commands, rather
> > than just showing the first file may/will also show the buffer-list,
> > but if exactly one of the files is shown it should be the first in the
> > list and next-buffer should go in the order in which the file names
> > were given (until reaching the end of this list at which point it'll
> > hit things like *Messages* and friends and that's fine).
>
> The questions I asked the OP still stand.  The required feature is not
> defined in sufficient detail.  If only the initial order is required,
> it's probably relatively easy, but then that order is very fragile and
> could easily break as soon as the user issues the first command.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 15:20:03 GMT) Full text and rfc822 format available.

Message #29 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: hoppe <travis.hoppe <at> gmail.com>
Cc: 21505 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 18:19:51 +0300
> From: hoppe <travis.hoppe <at> gmail.com>
> Date: Thu, 17 Sep 2015 10:59:41 -0400
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, tsdh <at> gnu.org, 21505 <at> debbugs.gnu.org
> 
> In response to the first question, I'd like this to be the "easy" request, that
> this behavior is only for when emacs opens and not continuously during the
> session. I agree, it does not need to be maintained during the session. 
> 
> Re: Tassilo Horn: I purposely showed my example with a wildcard since emacs
> could be given any expansion from the shell. To me it, and for my usual use
> case, it doesn't matter. I have a bunch of files I'd like to edit and I often
> miss those that are past the messages and scratch buffer. Opening the files in
> the order given from the command line seems very natural to me.
> 
> So to be clear, given the command run on the shell:
> 
> > emacs a c b
> 
> The buffer order should be [a,c,b,*messages*,*scratch*]. Currently the default
> behavior looks something like [b,c,*messages*,*scratch*, a]. 

So it's just an issue with the order in which buffers are presented in
the prompt of "C-x b"?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 15:25:02 GMT) Full text and rfc822 format available.

Message #32 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: hoppe <travis.hoppe <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 11:23:58 -0400
[Message part 1 (text/plain, inline)]
No, and this is why it's a little weird. On my computer when I create the
files a,b,c and run

> emacs a b c

the prompt of C-x b gives:

c
b
a
*scratch*
*Messages*

with file c opened first. BUT, the order of NextBuffer goes
[c->b->*Messages*->*scratch->a]

On Thu, Sep 17, 2015 at 11:19 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: hoppe <travis.hoppe <at> gmail.com>
> > Date: Thu, 17 Sep 2015 10:59:41 -0400
> > Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, tsdh <at> gnu.org,
> 21505 <at> debbugs.gnu.org
> >
> > In response to the first question, I'd like this to be the "easy"
> request, that
> > this behavior is only for when emacs opens and not continuously during
> the
> > session. I agree, it does not need to be maintained during the session.
> >
> > Re: Tassilo Horn: I purposely showed my example with a wildcard since
> emacs
> > could be given any expansion from the shell. To me it, and for my usual
> use
> > case, it doesn't matter. I have a bunch of files I'd like to edit and I
> often
> > miss those that are past the messages and scratch buffer. Opening the
> files in
> > the order given from the command line seems very natural to me.
> >
> > So to be clear, given the command run on the shell:
> >
> > > emacs a c b
> >
> > The buffer order should be [a,c,b,*messages*,*scratch*]. Currently the
> default
> > behavior looks something like [b,c,*messages*,*scratch*, a].
>
> So it's just an issue with the order in which buffers are presented in
> the prompt of "C-x b"?
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 15:45:02 GMT) Full text and rfc822 format available.

Message #35 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: hoppe <travis.hoppe <at> gmail.com>
Cc: 21505 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 18:44:22 +0300
> From: hoppe <travis.hoppe <at> gmail.com>
> Date: Thu, 17 Sep 2015 11:23:58 -0400
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, tsdh <at> gnu.org, 21505 <at> debbugs.gnu.org
> 
> No, and this is why it's a little weird. On my computer when I create the files
> a,b,c and run 
> 
> > emacs a b c 
> 
> the prompt of C-x b gives:
> 
> c 
> b
> a
> *scratch*
> *Messages*
> 
> with file c opened first. BUT, the order of NextBuffer goes
> [c->b->*Messages*->*scratch->a]

What or who is NextBuffer??  I cannot find any such string in the
entire Emacs source tree.  What am I missing?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 15:49:02 GMT) Full text and rfc822 format available.

Message #38 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: hoppe <travis.hoppe <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Tassilo Horn <tsdh <at> gnu.org>
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 11:48:37 -0400
[Message part 1 (text/plain, inline)]
I'm sorry, this is my first bug report and I'm not a power user of emacs.

When I say "Next Buffer" I mean, when I click on Buffers in the File Menu
one of the options is

Next Buffer <XF86FORWARD>

with the tooltip: Switch to the "next" buffer in a cyclic order. This, I
think, is identical to C-x right arrow.


On Thu, Sep 17, 2015 at 11:44 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: hoppe <travis.hoppe <at> gmail.com>
> > Date: Thu, 17 Sep 2015 11:23:58 -0400
> > Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, tsdh <at> gnu.org,
> 21505 <at> debbugs.gnu.org
> >
> > No, and this is why it's a little weird. On my computer when I create
> the files
> > a,b,c and run
> >
> > > emacs a b c
> >
> > the prompt of C-x b gives:
> >
> > c
> > b
> > a
> > *scratch*
> > *Messages*
> >
> > with file c opened first. BUT, the order of NextBuffer goes
> > [c->b->*Messages*->*scratch->a]
>
> What or who is NextBuffer??  I cannot find any such string in the
> entire Emacs source tree.  What am I missing?
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Thu, 17 Sep 2015 16:21:01 GMT) Full text and rfc822 format available.

Message #41 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: hoppe <travis.hoppe <at> gmail.com>
Cc: 21505 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Thu, 17 Sep 2015 19:20:53 +0300
> From: hoppe <travis.hoppe <at> gmail.com>
> Date: Thu, 17 Sep 2015 11:48:37 -0400
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, Tassilo Horn <tsdh <at> gnu.org>, 21505 <at> debbugs.gnu.org
> 
> When I say "Next Buffer" I mean, when I click on Buffers in the File Menu one
> of the options is 
> 
> Next Buffer <XF86FORWARD> 
> 
> with the tooltip: Switch to the "next" buffer in a cyclic order. This, I think,
> is identical to C-x right arrow.

Ah, okay.  Now everything is clear.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Sun, 20 Feb 2022 12:58:01 GMT) Full text and rfc822 format available.

Message #44 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, travis.hoppe <at> gmail.com, 21505 <at> debbugs.gnu.org,
 Tassilo Horn <tsdh <at> gnu.org>
Subject: Re: bug#21505: 24.4; Buffer order
Date: Sun, 20 Feb 2022 13:57:03 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> The precise behavior is a bit more complex since those commands, rather
> than just showing the first file may/will also show the buffer-list,
> but if exactly one of the files is shown it should be the first in the
> list and next-buffer should go in the order in which the file names
> were given (until reaching the end of this list at which point it'll
> hit things like *Messages* and friends and that's fine).

This behaviour is still present in Emacs 29.

But I'm wondering -- why is Emacs popping up a *Buffer List* window when
you ask it to open two files?  I'd have thought the obvious thing to do
in this situation is to open as many windows as there are files (if
possible)?  Or open a single window displaying the first file specified
(and then have the rest be in the next-buffer order you describe).

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Sun, 20 Feb 2022 13:21:01 GMT) Full text and rfc822 format available.

Message #47 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com, monnier <at> iro.umontreal.ca,
 tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Sun, 20 Feb 2022 15:20:27 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Tassilo Horn <tsdh <at> gnu.org>,  Eli Zaretskii <eliz <at> gnu.org>,
>   travis.hoppe <at> gmail.com,  21505 <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Mon, 21 Feb 2022 13:39:01 GMT) Full text and rfc822 format available.

Message #50 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com, monnier <at> iro.umontreal.ca,
 tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Mon, 21 Feb 2022 14:38:19 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> 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:

Ah, right.

>> 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.

Yes, I guess it does make sense to display the *Buffer list* when
there's a lot of files.

>> 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.

Yeah.

So I guess the only this to fix here is the buffer ordering, as the
original bug reporter was talking about -- i.e., ensure that *scratch*
and *Messages* are at the bottom of the list.  Currently, this is the
buffer order if given "a b c d e f" as the files:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
Which seems pretty chaotic.  I guess what we want to see here is

f
e
d
c
b
a
*scratch*
*Messages*

?  I mean, sorting the other way around (and selecting a) would also be
a possibility, but would be a greater behavioural change. 

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

Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Feb 2022 13:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Mon, 21 Feb 2022 13:56:02 GMT) Full text and rfc822 format available.

Message #55 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com, monnier <at> iro.umontreal.ca,
 tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Mon, 21 Feb 2022 15:55:35 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: monnier <at> iro.umontreal.ca,  tsdh <at> gnu.org,  travis.hoppe <at> gmail.com,
>   21505 <at> debbugs.gnu.org
> Date: Mon, 21 Feb 2022 14:38:19 +0100
> 
> I guess what we want to see here is
> 
> f
> e
> d
> c
> b
> a
> *scratch*
> *Messages*
> 
> ?  I mean, sorting the other way around (and selecting a) would also be
> a possibility, but would be a greater behavioural change. 

It'd be nice to have the order that is somehow related to the order of
visiting the files, yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21505; Package emacs. (Mon, 21 Feb 2022 14:44:01 GMT) Full text and rfc822 format available.

Message #58 received at 21505 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21505 <at> debbugs.gnu.org, travis.hoppe <at> gmail.com, monnier <at> iro.umontreal.ca,
 tsdh <at> gnu.org
Subject: Re: bug#21505: 24.4; Buffer order
Date: Mon, 21 Feb 2022 15:43:16 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> It'd be nice to have the order that is somehow related to the order of
> visiting the files, yes.

I've now done this in Emacs 29.

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




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Feb 2022 14:44:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 29.1, send any further explanations to 21505 <at> debbugs.gnu.org and hoppe <travis.hoppe <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Feb 2022 14:44:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Mar 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.