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

From: Juri Linkov <[email-masked]>
Date: Thu, 04 Jan 2024 19:07:39 +0200

>> Martin, is saving and restoring window configuration supposed to
>> preserve the output following in *compilation* windows?
>
> It's supposed to preserve markers other than in the selected window.  So
> it will depend on whether the *compilation* window gets selected.  But
> note that 'current-window-configuration' uses
> 'window-point-insertion-type' for the point marker which by default
> stays behind inserted text (IIRC).

Everything works nicely, and point follows the output,
when this code is removed from 'tab-bar-select-tab':

  ;; set-window-configuration does not restore the value of
  ;; point in the current buffer, so restore it separately.
  (when (and (markerp wc-point)
             (marker-buffer wc-point)
             ;; FIXME: After dired-revert, marker relocates to 1.
             ;; window-configuration restores point to global point
             ;; in this dired buffer, not to its window point,
             ;; but this is slightly better than 1.
             ;; Maybe better to save dired-filename in each window?
             (not (eq 1 (marker-position wc-point))))
    (goto-char wc-point))

The problem is that I still can't figure out in what cases point should be
restored manually.  For example, when a buffer was reverted in another
window configuration, then better to restore point manually to override
an invalidated marker?