GNU bug report logs - #57551
29.0.50; hide-show in python-mode selects the current block imperfectly

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Fri, 2 Sep 2022 21:26:01 UTC

Severity: normal

Found in version 29.0.50

Full log


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

From: Dima Kogan <dima <at> secretsauce.net>
To: kobarity <kobarity <at> gmail.com>
Cc: 57551 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: 29.0.50; hide-show in python-mode selects the current block
 imperfectly
Date: Mon, 05 Sep 2022 00:44:22 -0700
Hi. Thanks for the analysis. I guess this isn't the right forum for this
discussion, but I'll put it here anyway. The reason I think the "if" and
"else" text and the preceding whitespace should be considered to lie
outside their block is that this is how cc-mode works. Consider the
C code equivalent to the Python code in the bug report:

void f(void)
{
    if(1)
    {
        11;
    }
    else if(2)
    {
        22;
    }
    else if(3)
    {
        33;
    }
    else if(4)
    {
        44;
    }
    else
    {
        5;
    }

    return 0;
}

Here (hs-hide-block) hides the if/else blocks ONLY if the point is
inside the {}. Otherwise, the whole f() is hidden.




This bug report was last modified 2 years and 335 days ago.

Previous Next


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