Subject: bug#32850: 27.0.50; window-swap-states doesn't swap window prev/next-buffers

From: martin rudalics <[email-masked]>
Date: Thu, 18 Oct 2018 10:05:56 +0200

> When testing the previous patch, I noticed that killed buffers automatically
 > disappear from prev/next-buffers lists, so there are no #<killed buffer> remains.
 > Is it handled by code in kill-buffer?

'kill-buffer' calls 'replace-buffer-in-windows' which, if the window
doesn't show the buffer, calls 'unrecord-window-buffer' which removes
the buffer from the respective lists.  But 'replace-buffer-in-windows'
handles only live windows, it can't look into window configurations.

 > What do you think about creating new functions to convert the existing
 > states from non-writable to writable and back?  Then in the same session
 > it would be more optimal to use window states with buffer/mark objects,
 > and states to save to the desktop could be serialized by such functions.

It would be interesting to have such a thing.  One could use it to
handle conversion of non-writable objects to writable ones (I always
wondered how desktop would handle non-writable values in say
'dedicated' or a window parameter) and back.  But we don't yet have a
sufficiently reliable mechanism for providing a serializable value for
a number of our objects - in particular windows and frames.

martin