From: Yuan Fu <casouri@gmail.com>
To: daniel@kraus.my
Cc: 60044@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 [thread overview]
Message-ID: <326199CA-57DA-4C4A-B392-092E1FE03BC3@gmail.com> (raw)
In-Reply-To: <87y1rboyin.fsf@kraus.my>
Yuan Fu <casouri@gmail.com> writes:
> Daniel Kraus <daniel@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
prev parent reply other threads:[~2023-01-07 23:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 20:05 bug#60044: 30.0.50; hideshow in python-ts-mode not working Daniel Kraus
2022-12-16 1:19 ` Yuan Fu
2023-01-07 23:15 ` Yuan Fu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=326199CA-57DA-4C4A-B392-092E1FE03BC3@gmail.com \
--to=casouri@gmail.com \
--cc=60044@debbugs.gnu.org \
--cc=daniel@kraus.my \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).