Subject: bug#15382: desktop restores buffers in wrong order

From: Juanma Barranquero <[email-masked]>
Date: Tue, 17 Dec 2013 22:01:09 +0100

On Tue, Dec 17, 2013 at 8:58 PM, Juri Linkov <[email-masked]> wrote:

>   (unless (desktop-restoring-frameset-p)
>
> Why buffers should be restored in right order only when
> restoring a single-frame (without restoring a frameset)
> but not when restoring a single-frame from a frameset?

When desktop-restoring-frameset-p is nil you're not really "restoring
a single frame", because nothing about the frame (dimensions,
position, minibufferless state, window tree) is restored. You're
creating a new frame and restoring the buffers. In that case, the
window/buffer correspondence is not maintained so you can do whatever
you want with the buffer list order.

> Maybe buffers should be saved in the desktop in reverse order?
> This will restore the original order of the global buffer list.

You could try it with and without desktop-restore-frames and report back.

> And frame-local and window-local buffer lists needs to be saved too.

IIUC Martin's last comment, that's far from trivial.

    J