GNU bug report logs - #75387
29.4; hideshow: hs-hide-level hides multiple top-level blocks as one

Previous Next

Package: emacs;

Reported by: Christoph Groth <christoph <at> grothesque.org>

Date: Sun, 5 Jan 2025 18:54:01 UTC

Severity: normal

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 75387 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Christoph Groth <christoph <at> grothesque.org>, kobarity <kobarity <at> gmail.com>
Cc: 75387 <at> debbugs.gnu.org
Subject: Re: bug#75387: 29.4;
 hideshow: hs-hide-level hides multiple top-level blocks as one
Date: Sun, 12 Jan 2025 11:42:58 +0200
> From: Christoph Groth <christoph <at> grothesque.org>
> Date: Sun, 05 Jan 2025 19:53:04 +0100
> 
> I noticed the following problem when using a homemade function that
> allows me to cycle hideshow visibility in a way similar to org-mode.
> The issue, however, is independent of any customization (it appears with
> emacs -Q as well).
> 
> I can reproduce the issue with the following source file
> 
> https://gitlab.kwant-project.org/kwant/kwant/-/raw/0d679b3efecd145d13e3174c60d829a7c3cd4374/kwant/builder.py
> 
> I tried simplifying that file to isolate the issue, but did not arrive at
> something more useful than the original.  To demonstrate the issue:
> 
> (1) Download the above file.
> (2) Open it with emacs -Q builder.py.  Point is not moved.
> (3) M-x hs-minor-mode RET
> (4) M-x hs-hide-level RET
> 
> The result is that the buffer shows only two hidden blocks, with the
> buffer ending in
> 
> @total_ordering
> class SiteFamily(metaclass=abc.ABCMeta):...
> 
> This is incorrect, since there are many other classes and top-level
> functions in the file.  Each should appear as a separate top-level
> block.

Hm... the doc string of hs-hide-level says:

  Hide all blocks ARG levels below this block.

So what is "this block" when point is at position 1 in this buffer?

If I move point to here:

  @total_ordering
  class SiteFamily(metaclass=abc.ABCMeta):

and invoke hs-hide-level, then all the "def" blocks inside this one
are hidden, as expected.  And note that the command only hides blocks
that are inside the current block, not those inside other blocks of
the same level.

So this could be a documentation issue, whereby the doc string doesn't
explain clearly enough what the command does.

kobarity, any comments?




This bug report was last modified 95 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.