GNU bug report logs - #53913
28.0.91; python.el: Fancy 'outline-heading-end-regexp' doesn't work well

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Thu, 10 Feb 2022 09:15:01 UTC

Severity: normal

Found in version 28.0.91

Fixed in version 29.1

Done: Augusto Stoffel <arstoffel <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: 53913 <at> debbugs.gnu.org
Subject: bug#53913: 28.0.91; python.el: Fancy 'outline-heading-end-regexp' doesn't work well
Date: Thu, 10 Feb 2022 10:14:49 +0100
In python-mode, 'outline-heading-end-regexp' is set to ":[^\n]*\n", so
that a folded function definition still displays the argument list, like
this:

```
def f(
    a,
    b
):...
```

This is marginally nicer than what one would normally get, namely

```
def f(...
```

However, with the introduction of type hints, this special outline end
regexp doesn't work well anymore.  For instance, the code

```
def f(
    a: int,
    b: str
) -> bool:
    pass
```

folds as

```
def f(
    a: int,...
```

which is much worse than not trying to be fancy.

In view of that, I would suggest to keep 'outline-heading-end-regexp' at
its default value of "\n" in pyhton-mode.




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

Previous Next


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