Subject: Re: 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: Pip Cet <[email-masked]>
Date: Tue, 25 Feb 2025 16:31:07 +0000

João Moreira via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]> writes:

> HAPPENED
>
> Using magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) in some random ways blocks GNU Emacs while using feature/igc.

Thanks for the report!  I tried reproducing it, and indeed Emacs hangs
for several minutes in back_to_previous_visible_line_start.  However,
after that, it seems to become usable again.  I tried reproducing this
again and failed, though.

This is a bug, and it seems to be much worse with --with-mps=yes, but
the behavior with --with-mps=no is hardly ideal either.

The main difference appears to be the charpos<->bytepos cache in the
weak marker vector, which grows to 0x8000 entries.  That seems
excessive, but IIRC, what really matters is the order in which they're
tried.

> EXPECTED
>
> Magit does not block GNU Emacs.
>
> REPRODUCE
>
> 1. On a non-customized GNU Emacs feature/igc 48909543bdc7cfb605034398f2757e8d01004aca, eval
> ```emacs-lisp
> ;;;; PACKAGES
>
> (require 'package)
> (require 'package-vc)
> (require 'use-package)
>
> (defmacro my-package-install (package &optional feature &rest body)
>   "Set up PACKAGE from an Elisp archive, with rest BODY; require
> FEATURE instead of PACKAGE if given.
>
> PACKAGE is a quoted symbol, FEATURE is a quoted symbol, while BODY
> consists of balanced expressions.
>
> Try to install the package if it is missing.

I had to add a closing quote here.

Pip