unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: kobarity <kobarity@gmail.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	Dima Kogan <dima@secretsauce.net>,
	56635@debbugs.gnu.org
Subject: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks
Date: Mon, 08 Aug 2022 17:16:02 +0200	[thread overview]
Message-ID: <878rnyg40d.fsf@gmail.com> (raw)
In-Reply-To: <CAMQkrSo26PvzyAr4Mrgx6kQ0yx_-onZXGFkogkd=Nqt+OL5BMQ@mail.gmail.com> (kobarity@gmail.com's message of "Sun, 7 Aug 2022 23:37:59 +0900")

This is a marginally related remark, but I noticed that python-mode sets

    (setq-local outline-heading-end-regexp ":[^\n]*\n")

and this doesn't work well with the new-ish type annotation syntax.

Wouldn't it be better to simply remove this setting, reverting back to
the default "\n"?  Then folding by outline-minor-mode would behave like
hideshow currently does when it comes to something like

    def f(
        x: int
    ) -> int:
        pass

On Sun,  7 Aug 2022 at 23:37, kobarity <kobarity@gmail.com> wrote:

> Hi,
>
> Dima Kogan <dima@secretsauce.net> wrote:
>> I do agree that the best thing to do is to use functions instead of pure
>> regexes here. Can we hook that into hs-special-modes-alist instead of
>> doing something specific in python-mode? I'm imagining extending the
>> meaning of the fields in hs-special-modes-alist, where we'd do something
>> different, depending on if some element is a string or not. Maybe that
>> would make it easier to extend the hideshow support for other languages?
>
> If we are to extend hs-special-modes-alist, I think it's better to add
> functions to find/check blocks. Maybe this is the third option
> mentioned in the first mail.  For that, I added three functions to
> hs-special-modes-alist:
>
> - hs-find-block-beginning-func
> - hs-find-next-block-func
> - hs-looking-at-block-start-p-func
>
> Attached is a prototype patch to achieve this.
>
> Regards,





  reply	other threads:[~2022-08-08 15:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 22:20 bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks Dima Kogan
2022-07-23  7:58 ` Lars Ingebrigtsen
2022-07-23 15:51   ` kobarity
2022-07-23 20:41     ` Dima Kogan
2022-07-24  0:57       ` kobarity
2022-07-31 10:18         ` kobarity
2022-07-31 19:04           ` Dima Kogan
2022-08-07 14:37             ` kobarity
2022-08-08 15:16               ` Augusto Stoffel [this message]
2022-08-13 12:36                 ` kobarity
2022-08-15 15:00                   ` kobarity
2022-08-15 17:16                     ` Dima Kogan
2022-08-16  2:28                       ` kobarity
2022-08-17 10:45                     ` Lars Ingebrigtsen
2022-08-17 11:11                       ` Lars Ingebrigtsen
2022-08-17 11:32                         ` kobarity
2022-08-24  0:39                           ` Dima Kogan
2022-08-24 10:27                             ` Lars Ingebrigtsen
2022-08-24 14:15                               ` kobarity
2022-08-25 12:31                                 ` Lars Ingebrigtsen
2022-08-25 13:39                                   ` kobarity

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=878rnyg40d.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=56635@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    --cc=kobarity@gmail.com \
    --cc=larsi@gnus.org \
    /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).