Subject: Re: bug#13167: 24.3.50; C-x right C-x left interferes with buffer order

From: martin rudalics <[email-masked]>
Date: Mon, 17 Dec 2012 14:38:34 +0100

> There is one side-effect with overwrapping in next buffers.
 > When `C-x right C-x right' wraps to the first buffer *scratch*,
 > *scratch* is pushed to the list of next buffers.
 >
 > Then `C-x left C-x left' returns to the previous buffers,
 > typing `q' restores the right buffer, another `q' restores
 > another right buffer.  But the last `q' doesn't restore
 > the buffer *scratch*.
 >
 > This is in the following scenario:
 >
 >  1. emacs -Q
 >  2. C-h C-n
 >  3. C-x d RET
 >  4. v
 >  5. C-x right    displays the buffer *Messages*
 >  6. C-x right    displays the buffer *scratch*
 >  7. C-x left
 >  8. C-x left
 >  9. q
 > 10. q
 > 11. q
 > 12. q   the last q doesn't restore the initial buffer *scratch*

Is the list of previous buffers empty in step 12 ?  Then we could
heuristically show the last buffer added to the list of next buffers
here.  Preferring a buffer which is not on any of this window's lists
doesn't make much sense in this case, I think.

I guess that this scenario would also break the recipe you proposed
earlier, namely to keep next and previous buffers as lists built from
elements of the same type and not choose an element from the next
buffers when quitting.

martin