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

From: Juri Linkov <[email-masked]>
Date: Mon, 17 Dec 2012 11:57:52 +0200

> in `switch-to-prev-buffer' into
>
> 		   (not (memq new-buffer next-buffers)))
>
> and it works as expected.  Not sure about possible side-effects,
> have to test this change more.

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*