GNU bug report logs - #60044
30.0.50; hideshow in python-ts-mode not working

Previous Next

Package: emacs;

Reported by: Daniel Kraus <daniel <at> kraus.my>

Date: Tue, 13 Dec 2022 20:12:01 UTC

Severity: wishlist

Found in version 30.0.50

Full log


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

From: Yuan Fu <casouri <at> gmail.com>
To: daniel <at> kraus.my
Cc: 60044 <at> debbugs.gnu.org
Subject: Re: bug#60044: 30.0.50; hideshow in python-ts-mode not working
Date: Thu, 15 Dec 2022 17:19:49 -0800
Daniel Kraus <daniel <at> kraus.my> writes:

> Not sure if this is a bug report or feature request
> but I use hideshow for code folding and I see that
> `python-base-mode` only adds python-mode to hs-special-modes-alist:
>
>   (add-to-list
>    'hs-special-modes-alist
>    `(python-mode
>      ,python-nav-beginning-of-block-regexp
>      ;; Use the empty string as end regexp so it doesn't default to
>      ;; "\\s)".  This way parens at end of defun are properly hidden.
>      ""
>      "#"
>      python-hideshow-forward-sexp-function
>      nil
>      python-nav-beginning-of-block
>      python-hideshow-find-next-block
>      python-info-looking-at-beginning-of-block))
>
>
> Simply adding the same with python-ts-mode makes hideshow work
> but I guess maybe `python-nav-beginning-of-block` etc should
> be replaced with the equivalent tree-sitter functions?!
> Maybe it's the same with the other treesit modes, I haven't checked.
>
> Thanks,
>   Daniel

Thanks for reporting this! For now I just python-ts-mode to the setup,
as you suggested. In the future we will switch it to use tree-sitter.

Yuan




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

Previous Next


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