Subject: bug#33532: 26.1; set-window-configuration does not restore display start

From: martin rudalics <[email-masked]>
Date: Fri, 30 Nov 2018 18:47:30 +0100

> Perfect! This is what I need also for current-window-configuration!
 > Also, could this be made the default? Or is there some advantage in
 > using markers instead of the actual positions that can be restored?

First of all we need a "reasonable" use case.  The only purpose of a
form like

(let ((str (with-current-buffer buf (buffer-string))))
   (with-current-buffer buf
     (erase-buffer)
     (insert str)))

is to annihilate all marker positions in buf and I have yet to
understand why that could be useful.  I'm sure you have something more
reasonable in mind.  Once we have such a use case we can decide how to
best support it.

AFAICT Emacs' window configurations use window start and point markers
ever since.  And while they interfere with reverting buffers (see
Bug#33458 for a discussion) turning them into pure positions would
break far too many things as to make that the default.

We could store - in configurations and states - both, markers and
their corresponding pure positions.  Then if, when restoring a
configuration or state, a marker's position has dropped to 1 while the
corresponding saved pure position is > 1, use the the pure position
instead.  This should automatically fix your case and not violate any
others.  Juri what do you think?

martin