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


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: daniel <at> kraus.my
Cc: 60044 <at> debbugs.gnu.org
Subject: bug#60044: 30.0.50; hideshow in python-ts-mode not working
Date: Sat, 7 Jan 2023 15:15:47 -0800
Yuan Fu <casouri <at> gmail.com> writes:

> 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

Supporting hideshow with tree-sitter is harder that I thought. I didn’t
make it work. So "in the future" is now "in the distant future" :-)

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.