Subject: bug#76538: 31.0.50; 31.0.50; 31.0.50; feature/igc: using magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) in some random ways blocks GNU Emacs.

From: Eli Zaretskii <[email-masked]>
Date: Fri, 28 Feb 2025 10:19:56 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: Ihor Radchenko <[email-masked]>,  Eli Zaretskii <[email-masked]>,
>   [email-masked],  [email-masked],  [email-masked],
>   [email-masked]
> Date: Fri, 28 Feb 2025 06:19:34 +0100
> 
> Gerd Möllmann <[email-masked]> writes:
> 
> > In any case, I think I would try to change DO_MARKERS to start at the
> > end of the marker vector. If fix_marker_vector runs often enough one
> > could also "straighten" the free-list there, maybe.
> 
> Or one could build a doubly-linked list of markers in most-recently
> created order. But that would mean 3 array slots per marker in the
> marker vector. Don't know.

How about not relying on buffer markers too much for this job?  And in
particular, not adding any ephemeral markers when we don't find a
close-enough existing marker?  We could instead build our own data
structure, and make it so we could use efficient search methods.