GNU bug report logs - #15382
desktop restores buffers in wrong order

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Sun, 15 Sep 2013 09:29:02 UTC

Severity: minor

Merged with 23630

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 15382 <at> debbugs.gnu.org
Subject: bug#15382: desktop restores buffers in wrong order
Date: Wed, 05 Feb 2014 10:07:27 +0200
>> 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.

I tried to replace

  (dolist (l (mapcar 'desktop-buffer-info (buffer-list)))

with

  (dolist (l (mapcar 'desktop-buffer-info (nreverse (buffer-list))))

but it breaks the desktop saving by inserting the desktop file
to the current buffer.  Then I tried to replace it with

  (dolist (l (nreverse (mapcar 'desktop-buffer-info (buffer-list))))

and it saves the desktop in the natural order that could be replayed back
when restoring the desktop to get the buffer list in the same order.
But more code prevents from restoring in the same order, e.g.

	;; Restore buffer list order with new buffer at end. Don't change
	;; the order for old desktop files (old desktop module behavior).
	(unless (< desktop-file-version 206)
	  (mapc 'bury-buffer buffer-list)
	  (when result (bury-buffer result)))

I'm afraid that changing the order of buffers in the desktop file
might require incrementing the version number in desktop-file-version.




This bug report was last modified 8 years and 295 days ago.

Previous Next


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