GNU bug report logs - #56635
29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks

Previous Next

Package: emacs;

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

Date: Mon, 18 Jul 2022 22:21:01 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: kobarity <kobarity <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Dima Kogan <dima <at> secretsauce.net>, 56635 <at> debbugs.gnu.org
Subject: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks
Date: Sat, 13 Aug 2022 21:36:57 +0900
[Message part 1 (text/plain, inline)]
Augusto Stoffel <arstoffel <at> gmail.com> wrote:
>
> This is a marginally related remark, but I noticed that python-mode sets
>
>     (setq-local outline-heading-end-regexp ":[^\n]*\n")
>
> and this doesn't work well with the new-ish type annotation syntax.
>
> Wouldn't it be better to simply remove this setting, reverting back to
> the default "\n"?  Then folding by outline-minor-mode would behave like
> hideshow currently does when it comes to something like
>
>     def f(
>         x: int
>     ) -> int:
>         pass

I agree with removing the `outline-heading-end-regexp' setting.  I thought
about adding a custom variable since some people might prefer the
current setting, but I reconsidered that setting it as a file local
variable would be sufficient as described in docstring:

#+begin_quote
The recommended way to set this is with a ‘Local Variables:’ list
in the file it applies to.
#+end_quote

Is there any comments on extending `hs-special-modes-alist'?  Attached
are revised patches.  I would like to know if it is worth extending
`hs-special-modes-alist'.

Best Regards,
[fix-56635-hideshow.patch (application/octet-stream, attachment)]
[fix-56635-python.patch (application/octet-stream, attachment)]

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

Previous Next


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