Eli Zaretskii wrote: > > > From: lorniu > > Date: Fri, 24 May 2024 16:40:39 +0800 > > > > > > When I run `hs-hide-all` in python mode for some python files, > > It cannot work properly. > > > > For example, the `class` in following code can not be hide: > > > > ``` > > if TYPE_CHECKING: > > Base64FileInput = Union[IO[bytes], PathLike[str]] > > FileContent = Union[IO[bytes], bytes, PathLike[str]] > > else: > > Base64FileInput = Union[IO[bytes], PathLike] > > FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. > > > > class aaa: > > ... > > ``` > > > > Maybe the issue caused by function in `python-hideshow-find-next-block` > > of python.el, that the comment regexp should be "^#" instead of "#"? > > Shouldn't that be something like "^[:space:]*#" instead? Hi lorniu, Thanks for pointing out this issue. After running `hs-hide-all', the buffer will be like this: ``` if TYPE_CHECKING:... else:... # PathLike is not subscriptable in Python 3.8. class aaa: ... ``` As you pointed out, the class aaa is not hidden. However, it is also a problem that the comment is not hidden. I think it is better to fix `python-hideshow-forward-sexp-function' to move the point to the end of the line to include the comment. Attached is the patch to do that.