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

From: Juanma Barranquero <[email-masked]>
Date: Tue, 17 Dec 2013 17:07:27 +0100

On Mon, Dec 16, 2013 at 10:05 PM, Juri Linkov <[email-masked]> wrote:

> Because I see no other explanation.  This was added by your revno:113483
>
> 2013-07-21  Juanma Barranquero  <[email-masked]>
>
>         * desktop.el (desktop-saved-frame-states):
>         ...
>         (desktop-read): Use desktop-restoring-frames-p.  Do not try to fix
>         buffer-lists when restoring frames.  Suggested by Martin Rudalics.

I understand why my change is related to not restoring the buffer list
order. I do not see why do you think that it is intended only for the
multi-frame case. Restoring framesets is not intended just for
multi-frame setups, I use it all the time in my single-frame setup.

> Maybe Martin knows the purpose of not fixing buffer-lists in desktop-read?

Correctly restoring the frames requires restoring the window-buffer
correspondence, so if you run the (mapc #'bury-buffer ...) code
afterwards, you destroy that correspondence. A way would be required
to reset buffer-list's without affecting how buffers are displayed...

    J