Subject: Re: bug#33871: 27.0.50; Revert Dired window saved in window configuration

From: martin rudalics <[email-masked]>
Date: Sun, 30 Dec 2018 10:52:58 +0100

> image-revert is another special, as indicated by bug#33631

But there the position of point or that of its window has no impact, I
presume.

 > Do you know why it currently moves point to the end of the buffer
 > in non-selected windows.  I don't understand what causes this behavior.

I nowlooked into it.  It's a bug caused by

	  XMARKER (p->pointm)->insertion_type
	    = !NILP (buffer_local_value /* Don't signal error if void.  */
		     (Qwindow_point_insertion_type, w->contents));

and the value of

buffer_local_value (Qwindow_point_insertion_type, w->contents)

is unbound and not nil.  I have to fix that.

 >> As I suggested earlier we can use the position of the buffer's point
 >> in every window regardless of whether it currently shows the buffer or
 >> we later switch to the buffer in it.  But this is not what we usually
 >> want when using multiple windows: We usually want them to show
 >> different portions of the same buffer.
 >
 > Yes, better to keep every window's own point.  Since usually I save
 > the selected window's point along with the window configuration,

As number or as marker?

 > in e.g.
 >
 > ((window-configuration-1 selected-window-point)
 >   (window-configuration-2 selected-window-point)
 >   ...)
 >
 > this could be extended to save a mapping of all windows points, e.g.
 >
 > ((window-configuration-1 ((window-a point-a) (window-b point-b) ...))
 >   (window-configuration-2 ...)
 >   ...)
 >
 >
 > But it's not a general solution.  A general solution would be to save
 > such metadata in the window configuration itself.

But a configuration saves the point of each window, for the selected
one it stores the point of that window's buffer.  Is it just because
you want to be able to retrieve those values?  Or what am I missing?

martin