GNU bug report logs - #80009
[PATCH] hideshow: Support nested comment block in 'hs-hide-level-recursive'

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Sun, 14 Dec 2025 22:27:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 80009 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to juri <at> linkov.net, bug-gnu-emacs <at> gnu.org:
bug#80009; Package emacs. (Sun, 14 Dec 2025 22:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Elijah Gabe Pérez <eg642616 <at> gmail.com>:
New bug report received and forwarded. Copy sent to juri <at> linkov.net, bug-gnu-emacs <at> gnu.org. (Sun, 14 Dec 2025 22:27:02 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] hideshow: Support nested comment block in
 'hs-hide-level-recursive'
Date: Sun, 14 Dec 2025 16:25:57 -0600
[Message part 1 (text/plain, inline)]
Tags: patch

Previously, `hs-hide-level-recursive` had partial support for hiding
nested comments, this patch should now provide a more complete support.

My only question is if we need an option (similar to
`hs-hide-comments-when-hiding-all`) for `hs-hide-level` and `hs-cycle`,
because these commands only hides code blocks, not comments.

[0001-hideshow-Support-nested-comment-block-in-hs-hide-lev.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
- E.G via Gnus and Org.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80009; Package emacs. (Mon, 15 Dec 2025 07:47:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: 80009 <at> debbugs.gnu.org
Subject: Re: bug#80009: [PATCH] hideshow: Support nested comment block in
 'hs-hide-level-recursive'
Date: Mon, 15 Dec 2025 09:44:28 +0200
> Previously, `hs-hide-level-recursive` had partial support for hiding
> nested comments, this patch should now provide a more complete support.
>
> My only question is if we need an option (similar to
> `hs-hide-comments-when-hiding-all`) for `hs-hide-level` and `hs-cycle`,
> because these commands only hides code blocks, not comments.

Does it make sense to reuse the existing `hs-hide-comments-when-hiding-all`
for `hs-hide-level` and `hs-cycle` as well?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80009; Package emacs. (Tue, 16 Dec 2025 02:35:02 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 80009 <at> debbugs.gnu.org
Subject: Re: bug#80009: [PATCH] hideshow: Support nested comment block in
 'hs-hide-level-recursive'
Date: Mon, 15 Dec 2025 20:33:13 -0600
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>> My only question is if we need an option (similar to
>> `hs-hide-comments-when-hiding-all`) for `hs-hide-level` and `hs-cycle`,
>> because these commands only hides code blocks, not comments.
>
> Does it make sense to reuse the existing `hs-hide-comments-when-hiding-all`
> for `hs-hide-level` and `hs-cycle` as well?

Probably yes, but I don't find it convenient to use this option to
"govern" these commands, since some users would prefer that only certain
commands can do this. (e.g. only make hs-hide-all and hs-hide-level can
hide comments, hs-cycle not, and so on)

Anyways I've implemented your suggestion.

[0001-hideshow-Support-nested-comment-block-in-hs-hide-lev.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
- E.G via Gnus and Org.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80009; Package emacs. (Tue, 16 Dec 2025 12:54:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: 80009 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#80009: [PATCH] hideshow: Support nested comment block in
 'hs-hide-level-recursive'
Date: Tue, 16 Dec 2025 14:53:21 +0200
> Cc: 80009 <at> debbugs.gnu.org
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Date: Mon, 15 Dec 2025 20:33:13 -0600
> 
>  @table @code
>  @item hs-hide-comments-when-hiding-all
> -If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides
> -comments too.
> +If non-@code{nil}, @code{hs-hide-all}, @code{hs-cycle} and
> +@code{hs-hide-level} hides comments too.
                        ^^^^^
"hide", plural.  And why did you remove the keyboard key sequence for
hs-hide-all?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80009; Package emacs. (Tue, 16 Dec 2025 17:32:02 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80009 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#80009: [PATCH] hideshow: Support nested comment block in
 'hs-hide-level-recursive'
Date: Tue, 16 Dec 2025 11:30:56 -0600
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: 80009 <at> debbugs.gnu.org
>> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
>> Date: Mon, 15 Dec 2025 20:33:13 -0600
>> 
>>  @table @code
>>  @item hs-hide-comments-when-hiding-all
>> -If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides
>> -comments too.
>> +If non-@code{nil}, @code{hs-hide-all}, @code{hs-cycle} and
>> +@code{hs-hide-level} hides comments too.
>                         ^^^^^
> "hide", plural.  And why did you remove the keyboard key sequence for
> hs-hide-all?

I think it was unnecessary for me to describe the keybinding here as
well (hs-hide-all is bound to two keys (C-c @ C-M-h and C-c @ C-t) so
`C-c @ C-t` should also be described here), also the key sequences were
already described above in the manual, so i don't think this change will
hurt.

[0001-hideshow-Support-nested-comment-block-in-hs-hide-lev.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
- E.G via Gnus and Org.

This bug report was last modified today.

Previous Next


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