bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57551: 29.0.50; hide-show in python-mode selects the current block i


From: Andreas Röhler
Subject: bug#57551: 29.0.50; hide-show in python-mode selects the current block imperfectly
Date: Mon, 5 Sep 2022 11:42:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0


Am 05.09.22 um 09:44 schrieb Dima Kogan:
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.




There is another point: might be more than one if-statement in a function. If the whole function-body is collapsed from just one statement, the others are invisible too.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]