Subject: Re: bug#68235: 29.1.90; Switching tabs stops following process output in selected window

From: martin rudalics <[email-masked]>
Date: Sun, 7 Jan 2024 15:54:44 +0100

> window-point-insertion-type is nil by default, but I'd definitely want
 > point to follow the output, that means not using the snippet above.

But 'window-point-insertion-type' is buffer-locally t in all sorts of
compilation buffers and that is the subject of this bug report.  Right?

 > OTOH, this snippet can't be removed because it supports tab-local point.
 > For example, open the same buffer in two tabs and move point to another
 > place.  Like with window-point, the position of point in tabs should be
 > preserved as well.  So probably we need to add special-casing for comint
 > buffers to follow the output.

And I meant to use the buffer-local value of
'window-point-insertion-type' as insertion type for 'wc-point'.

 > But could you explain why such special-casing is not needed for
 > non-selected windows?  How set-window-configuration does the right
 > thing for points in non-selected windows to follow the output?
 > Maybe it's possible to do the same with point in the selected window?

For an unselected window, 'set-window-configuration' uses that window's
point marker from the saved configuration and that one should follow
inserted text according to the value of 'window-point-insertion-type' in
that window's buffer.  For the selected window, that window's buffer's
point is "usually" unchanged from where it was just before restoring the
configuration.

In either case I doubt that the 'set-window-configuration' code does
anything wrong here.  IIRC there were problems in the dired buffer
reverting code, namely that it did not preserve the position of point
reasonably and you tried to handle that via 'wc-point'.

martin