Subject: bug#77924: 31.0.50; [Feature branch] Change marker implementation

From: martin rudalics <[email-masked]>
Date: Thu, 24 Apr 2025 10:01:23 +0200

> BTW, during my rebasing I noticed the following incompatibility:
 >
 >      commit 89ad510b2ebd5ed3ed8477e4a45ada3402bcedca
 >      Author: Gerd Möllmann <[email-masked]>
 >      Date:   Thu Apr 17 08:42:52 2025 +0200
 >
 >          marker-vector.c: Move marker's position info to the array
 >
 > makes it "impossible" to implement `marker-last-position`.

What would 'markerp' then return for a marker whose buffer has been
killed?  The idea of 'marker-last-position' is that if some agent (like
a tab bar entry) keeps a reference to a killed buffer, that buffer
cannot be collected and neither its markers, although the latter have
been unchained already.  ‘marker-position’ would always return nil for
such a marker but 'marker-last-position' would have worked in the past.

 > AFAICT this function is not used outside of Emacs at all (based on
 > a search of all *ELPA packages), but it *is* used in
 > `window--state-put-2`, since the following commit:
 >
 >      commit 912e37b811107768e0cb3bc95184177f817dbdb2
 >      Author: Martin Rudalics <[email-masked]>
 >      Date:   Mon Mar 4 10:33:49 2024 +0100
 >
 >          Fix 'set-window-configuration' and 'window-state-put'
 >
 > What's the impact of breaking `marker-last-position`?

If 'window-restore-killed-buffer-windows' is a function that tries to
resurrect a killed buffer, it could not derive the position of the start
and point position of the buffer in that window.  So AFAICT the function
'tab-bar-select-restore-windows' would be affected.  Juri can tell more.

martin