Subject: Re: bug#75387: 29.4; hideshow: hs-hide-level hides multiple top-level blocks as one

From: Christoph Groth <[email-masked]>
Date: Sun, 02 Feb 2025 23:41:28 +0100

kobarity wrote:

> I think I've found the root cause.  `python-nav-end-of-statement' may
> fail to find the end of a long triple-quoted string when the buffer is
> "fresh".  It uses the following code to find the end of
> a triple-quoted string:
>
> (...)
>
> Attached is a patch to fix this issue.  I changed the above search to
> searching for triple-quotes and checking syntax.  Checking syntax
> involves `syntax-ppss' and syntax properties up to the point are
> updated.

I verified that the patch indeed solves the issue for me and
does not seem to introduce any other problem.

These were the steps that I followed:

• In my Emacs 29.4 from Debian stable, I copied the function
  python-nav-end-of-statement to *scratch*.

• There, I manually applied the change from the patch.

• I evaluated the function definition.

• I tried to reproduce the issue in a “fresh” builder.py buffer, but it
  no longer appears.

Thanks
Christoph