GNU bug report logs - #56635
29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Mon, 18 Jul 2022 22:21:01 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56635 in the body.
You can then email your comments to 56635 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Mon, 18 Jul 2022 22:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dima Kogan <dima <at> secretsauce.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 18 Jul 2022 22:21:01 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dima <at> secretsauce.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; [PATCH] hide-show in python-mode supports ONLY function
 and class blocks
Date: Mon, 18 Jul 2022 15:20:30 -0700
Hi. I'm using hide-show mode to visually collapse blocks while coding.
This is very helpful, and works great in C-like modes. hide-show mode
currently supports Python in a limited fashion: only def: and class:
blocks are hidden. Other kinds of blocks (if, else, for, while, ...) are
not supported. A simple patch that mostly adds support for all other
kinds of blocks is:

  diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
  index 1c99937c4b9..b63d2bc0690 100644
  --- a/lisp/progmodes/python.el
  +++ b/lisp/progmodes/python.el
  @@ -4819,7 +4819,7 @@ python-describe-at-point
   (defun python-hideshow-forward-sexp-function (_arg)
     "Python specific `forward-sexp' function for `hs-minor-mode'.
   Argument ARG is ignored."
  -  (python-nav-end-of-defun)
  +  (python-nav-end-of-block)
     (unless (python-info-current-line-empty-p)
       (backward-char)))

  @@ -5766,8 +5766,8 @@ python-mode

     (add-to-list
      'hs-special-modes-alist
  -   '(python-mode
  -     "\\s-*\\_<\\(?:def\\|class\\)\\_>"
  +   `(python-mode
  +     ,(python-rx block-start)
        ;; Use the empty string as end regexp so it doesn't default to
        ;; "\\s)".  This way parens at end of defun are properly hidden.
        ""

I say "mostly" because this isn't doable with regular expressions, as is
required by hide-show mode. So this patch can confuse the parser: some
bits of code will look like they begin a block, while in reality they do
not. hide-show would then collapse lines that it should ignore. Some
Python code that shows this failure:

  if 0:

      aaa
      l = [ i for i in range(5) \
            if i < 3 ]
      ccc
      abc = o.match(1,2,3)
      ddd

Here the "for" and "if" in the list comprehension both trigger the block
hiding. And the "match" function call triggers it too. python-mode has
functions to move between blocks (python-nav-...), but they're not
completely regex-based, so they can't be baked into hide-show.
Suggestions?

Obvious options:

  1. Leave the code as it is, don't support other blocks

  2. Take this patch, with the understanding that it'll collapse some
     stuff that it shouldn't

  3. Patch hide-show to potentially accept non-regex logic

I've been dogfooding the patch for a few days now, and it's behaving 99%
properly for me, so I'm inclined to suggest option 2. Making hide-show
smarter (option 3) doesn't feel worth the effort to fix THIS problem.

Thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sat, 23 Jul 2022 08:00:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: kobarity <kobarity <at> gmail.com>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sat, 23 Jul 2022 09:58:57 +0200
Dima Kogan <dima <at> secretsauce.net> writes:

> Obvious options:
>
>   1. Leave the code as it is, don't support other blocks
>
>   2. Take this patch, with the understanding that it'll collapse some
>      stuff that it shouldn't
>
>   3. Patch hide-show to potentially accept non-regex logic
>
> I've been dogfooding the patch for a few days now, and it's behaving 99%
> properly for me, so I'm inclined to suggest option 2. Making hide-show
> smarter (option 3) doesn't feel worth the effort to fix THIS problem.

Hm; don't know either.  Kobarity's done some work in related areas in
python-mode lately, and perhaps has some comments, so added to the CCs.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sat, 23 Jul 2022 15:52:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Dima Kogan <dima <at> secretsauce.net>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sun, 24 Jul 2022 00:51:21 +0900
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Hm; don't know either.  Kobarity's done some work in related areas in
> python-mode lately, and perhaps has some comments, so added to the CCs.

Thank you for letting me know about this issue.
It would be nice if Python hideshow works for blocks.  May I have some
time to think about it?

Regards,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sat, 23 Jul 2022 20:47:02 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dima <at> secretsauce.net>
To: kobarity <kobarity <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.oradg>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sat, 23 Jul 2022 13:41:27 -0700
Thanks for taking the time to look at this. After a big more dogfooding,
I've a small tweak to the first piece of the patch:

  diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
  index 1c99937c4b9..2b2b0900bee 100644
  --- a/lisp/progmodes/python.el
  +++ b/lisp/progmodes/python.el
  @@ -4819,9 +4819,7 @@ python-describe-at-point
   (defun python-hideshow-forward-sexp-function (_arg)
     "Python specific `forward-sexp' function for `hs-minor-mode'.
   Argument ARG is ignored."
  -  (python-nav-end-of-defun)
  -  (unless (python-info-current-line-empty-p)
  -    (backward-char)))
  +  (python-nav-end-of-block))

   
   ;;; Imenu

So (python-hideshow-forward-sexp-function) should call
(python-nav-end-of-block) and do nothing else. I think the extra
(backward-char) stuff was intended to handle the closing brace of the
block, which doesn't exist in Python. If you leave the (backward-char)
stuff there, the collapsed blocks still display the last character in
the block, which in Python has no special syntactical meaning.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sun, 24 Jul 2022 00:58:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.oradg>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sun, 24 Jul 2022 09:57:13 +0900
Hi Dima,

Dima Kogan <dima <at> secretsauce.net> wrote:
> So (python-hideshow-forward-sexp-function) should call
> (python-nav-end-of-block) and do nothing else. I think the extra
> (backward-char) stuff was intended to handle the closing brace of the
> block, which doesn't exist in Python. If you leave the (backward-char)
> stuff there, the collapsed blocks still display the last character in
> the block, which in Python has no special syntactical meaning.

This is one point I was thinking of.  The first patch failed to pass
ERTs python-hideshow-hide-levels-1 and python-hideshow-hide-levels-2.
The second patch still fails with python-hideshow-hide-levels-1, but I
think it's OK to fix the ERT:

diff --git a/test/lisp/progmodes/python-tests.el
b/test/lisp/progmodes/python-tests.el
index 3b10bde23b..8cb2aa84d0 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -5828,8 +5828,11 @@ python-hideshow-hide-levels-1
 class SomeClass:

     def __init__(self, arg, kwarg=1):
+
     def filter(self, nums):
-    def __str__(self):"))))
+
+    def __str__(self):
+"))))
       (or enabled (hs-minor-mode -1)))))

 (ert-deftest python-hideshow-hide-levels-2 ()


It would be better to add some ERTs for blocks.

Another point I am thinking of is to improve the regex.  As
hs-special-modes-alist has a support of the form (COMPLEX-START
MDATA-SELECTOR), I tried with the code below:

  (add-to-list
   'hs-special-modes-alist
   `(python-mode
     (,(python-rx (seq (or (seq buffer-start (? ?\n)) (seq (not ?\\) ?\n))
                       (* space) (group block-start))) 1)
     ;; 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))

This code solves many problems of `hs-hide-block' mentioned in the
first mail, but it breaks `hs-hide-level'.  It seems that current
MDATA-SELECTOR support is limited and needs some fixes if we want to
do something like above.  I will look into this a little bit more.

Regards,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sun, 31 Jul 2022 10:19:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sun, 31 Jul 2022 19:18:26 +0900
[Message part 1 (text/plain, inline)]
I wrote:
> This code solves many problems of `hs-hide-block' mentioned in the
> first mail, but it breaks `hs-hide-level'.  It seems that current
> MDATA-SELECTOR support is limited and needs some fixes if we want to
> do something like above.  I will look into this a little bit more.

There are some problems in this approach.  The biggest one is the way
of processing in `hs-hide-level-recursive'.  It basically repeats:

1. hs-hide-block-at-point
2. forward-comment
3. re-search-forward hs-block-start-regexp

Let me explain with the following code:

#+begin_src python
class C:
    def a():
        pass

    def b():
        pass
#+end_src

Let's assume that point is at the beginning of the line "def a():".
The first step hides the method "a" and moves the point to the end of the
block.  The second step moves the point to the position "d" of "def b():",
not the beginning of the line.  Therefore, if hs-block-start-regexp
contains rx line-start, it fails to match "def b():".

Although this can be solved by adding a flag or a mode specific
forward-comment function to hs-special-modes-alist, I'm not sure if it
is the right approach.

So I think the following setting is best at this moment.

#+begin_src elisp
  (add-to-list
   'hs-special-modes-alist
   `(python-mode
     ,(python-rx (seq (* (syntax ?-)) block-start))
     ;; 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))
#+end_src

(* (syntax ?-)) corresponds to "\\s-*" of the current regexp.  It
allows the point to be located before the block start symbols.

Another idea to improve the behavior of hiding a block is to provide a
wrapper function of `hs-hide-block' as follows and remap the key
bindings to this function like `python-mark-defun'.  With this
approach, C-c @ C-d and C-c @ C-h work as expected with the example
shown in the first mail.

#+begin_src elisp
(defun python-hideshow-hide-block (&optional end)
  "Python specific `hs-hide-block' function for `hs-minor-mode'.
Argument END is passed to `hs-hide-block'."
  (interactive "P")
  (python-nav-beginning-of-block)
  (hs-hide-block end))
#+end_src

Attached is a PoC level patch of this approach.  What do you think of
this approach?

Regards,
[56635-poc.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sun, 31 Jul 2022 19:55:01 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dima <at> secretsauce.net>
To: kobarity <kobarity <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sun, 31 Jul 2022 12:04:48 -0700
Hi. Thanks for looking at this.

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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sun, 07 Aug 2022 14:39:01 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sun, 7 Aug 2022 23:37:59 +0900
[Message part 1 (text/plain, inline)]
Hi,

Dima Kogan <dima <at> 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,
[56635-prototype.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Mon, 08 Aug 2022 15:17:02 GMT) Full text and rfc822 format available.

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

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: kobarity <kobarity <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: 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
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 <at> gmail.com> wrote:

> Hi,
>
> Dima Kogan <dima <at> 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,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Sat, 13 Aug 2022 12:38:01 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Sat, 13 Aug 2022 21:36:57 +0900
[Message part 1 (text/plain, inline)]
Augusto Stoffel <arstoffel <at> gmail.com> wrote:
>
> 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

I agree with removing the `outline-heading-end-regexp' setting.  I thought
about adding a custom variable since some people might prefer the
current setting, but I reconsidered that setting it as a file local
variable would be sufficient as described in docstring:

#+begin_quote
The recommended way to set this is with a ‘Local Variables:’ list
in the file it applies to.
#+end_quote

Is there any comments on extending `hs-special-modes-alist'?  Attached
are revised patches.  I would like to know if it is worth extending
`hs-special-modes-alist'.

Best Regards,
[fix-56635-hideshow.patch (application/octet-stream, attachment)]
[fix-56635-python.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Mon, 15 Aug 2022 15:02:01 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>, 
 Lars Ingebrigtsen <larsi <at> gnus.org>, 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Tue, 16 Aug 2022 00:00:48 +0900
[Message part 1 (text/plain, inline)]
I wrote:
> Is there any comments on extending `hs-special-modes-alist'?  Attached
> are revised patches.  I would like to know if it is worth extending
> `hs-special-modes-alist'.

I fixed some issues in the Python patch.  Please note that the fix for
#57223 (merged recently) is also needed for all ERTs to pass.

Best Regards,
[fix-56635-python.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Mon, 15 Aug 2022 17:21:01 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dima <at> secretsauce.net>
To: kobarity <kobarity <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Augusto Stoffel <arstoffel <at> gmail.com>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Mon, 15 Aug 2022 10:16:14 -0700
Thanks for working on this. I'll try it out in a bit. How do you usually
test it?

The main modification is in

  (define-derived-mode python-mode prog-mode "Python" ...
    ...
    (add-to-list
     'hs-special-modes-alist
     `(python-mode
       ....

Re-evaluating the (define-derived-mode ...) form doesn't do it,
obviously. I've tried to manually update hs-special-modes-alist, but
that doesn't work right either. What do you do? Ideally I'd like to drop
something into my ~/.emacs to use the patched logic to long-term test
this, but I haven't been able to figure it out.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Tue, 16 Aug 2022 02:29:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Augusto Stoffel <arstoffel <at> gmail.com>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Tue, 16 Aug 2022 11:28:40 +0900
Dima Kogan <dima <at> secretsauce.net> wrote:
> Thanks for working on this. I'll try it out in a bit. How do you usually
> test it?

You need the latest source code (master branch) to apply the patches.
Here are how to test them:

- patch -p1 < fix-56635-hideshow.patch
- patch -p1 < fix-56635-python.patch
- emacs -Q
- M-x load-file "patched python.el"
- M-x load-file "patched hideshow.el"
- M-x find-file "Python file to test"
- M-x hs-minor-mode

If you want to load patched files in ~/.emacs, following settings
should suffice:

(load "/somewhere patched/python.el")
(load "/somewhere patched/hideshow.el")

As for ERTs, I'm testing them with the following command in the
patched source code tree:

src/emacs -batch -l ert -l lisp/progmodes/hideshow.el -l
lisp/progmodes/python.el -l test/lisp/progmodes/python-tests.el -l
test/lisp/progmodes/hideshow-tests.el --eval '(let
((python-tests-shell-interpreter "python3"))
(ert-run-tests-batch-and-exit))'

I'm looking forward to your feedback.

Regards,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Wed, 17 Aug 2022 10:46:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: kobarity <kobarity <at> gmail.com>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Wed, 17 Aug 2022 12:45:20 +0200
kobarity <kobarity <at> gmail.com> writes:

> I fixed some issues in the Python patch.  Please note that the fix for
> #57223 (merged recently) is also needed for all ERTs to pass.

Thanks; pushed to Emacs 29.





bug marked as fixed in version 29.1, send any further explanations to 56635 <at> debbugs.gnu.org and Dima Kogan <dima <at> secretsauce.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 17 Aug 2022 10:46:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Wed, 17 Aug 2022 11:12:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: kobarity <kobarity <at> gmail.com>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Wed, 17 Aug 2022 13:11:26 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>
> kobarity <kobarity <at> gmail.com> writes:
>
>> I fixed some issues in the Python patch.  Please note that the fix for
>> #57223 (merged recently) is also needed for all ERTs to pass.
>
> Thanks; pushed to Emacs 29.

This led to test failures I didn't notice before pushing:

4 unexpected results:
   FAILED  python-hideshow-hide-all-2
   FAILED  python-hideshow-hide-block-1
   FAILED  python-hideshow-hide-levels-1
   FAILED  python-hideshow-hide-levels-2

So I've now reverted the change.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Wed, 17 Aug 2022 11:34:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Wed, 17 Aug 2022 20:32:51 +0900
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> This led to test failures I didn't notice before pushing:
>
> 4 unexpected results:
>    FAILED  python-hideshow-hide-all-2
>    FAILED  python-hideshow-hide-block-1
>    FAILED  python-hideshow-hide-levels-1
>    FAILED  python-hideshow-hide-levels-2
>
> So I've now reverted the change.

Sorry for the confusion.  It depends on the patch for hideshow.el
(fix-56635-hideshow.patch) presented in:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56635#32

All tests should pass if both patches are applied.  However, I think
we can wait for feedbacks from Dima and (hopefully) others.

Best Regards,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Wed, 24 Aug 2022 00:49:02 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dima <at> secretsauce.net>
To: kobarity <kobarity <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Augusto Stoffel <arstoffel <at> gmail.com>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Tue, 23 Aug 2022 17:39:39 -0700
Hi. Thanks for working on this. I just tried this out, and it appears to
work well! I think we can merge this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Wed, 24 Aug 2022 10:28:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: kobarity <kobarity <at> gmail.com>, Augusto Stoffel <arstoffel <at> gmail.com>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Wed, 24 Aug 2022 12:27:04 +0200
Dima Kogan <dima <at> secretsauce.net> writes:

> Hi. Thanks for working on this. I just tried this out, and it appears to
> work well! I think we can merge this.

Since this depends on two patch sets (and there are different ones?),
could you (kobarity, that is) repost the patches (in the order they
should be applied), and I'll get them pushed.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Wed, 24 Aug 2022 14:16:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Wed, 24 Aug 2022 23:15:31 +0900
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> Dima Kogan <dima <at> secretsauce.net> writes:
>
> > Hi. Thanks for working on this. I just tried this out, and it appears to
> > work well! I think we can merge this.
>
> Since this depends on two patch sets (and there are different ones?),
> could you (kobarity, that is) repost the patches (in the order they
> should be applied), and I'll get them pushed.

Dima, thank you for your feedback!

Lars, attached are the revised and rebased patches.  They should be
applied in the order:

- 1-hideshow.patch
- 2-python.patch

No other patches are required.  Thank you for your cooperation.

Best regards,
[1-hideshow.patch (application/octet-stream, attachment)]
[2-python.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Thu, 25 Aug 2022 12:32:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: kobarity <kobarity <at> gmail.com>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Thu, 25 Aug 2022 14:31:26 +0200
kobarity <kobarity <at> gmail.com> writes:

> Lars, attached are the revised and rebased patches.  They should be
> applied in the order:
>
> - 1-hideshow.patch
> - 2-python.patch
>
> No other patches are required.  Thank you for your cooperation.

Thanks; pushed to Emacs 29.  I had to apply the patches "by hand"
instead of with "git am" because "git am" complained:

---
Nonempty second line in commit message
Commit aborted; please see the file CONTRIBUTE
---

I'm not quite sure what that refers to -- the second line looked pretty
empty to me (except some spaces).  But even removing those spaces didn't
help.





bug marked as fixed in version 29.1, send any further explanations to 56635 <at> debbugs.gnu.org and Dima Kogan <dima <at> secretsauce.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 25 Aug 2022 12:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56635; Package emacs. (Thu, 25 Aug 2022 13:41:01 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, Dima Kogan <dima <at> secretsauce.net>,
 56635 <at> debbugs.gnu.org
Subject: Re: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports
 ONLY function and class blocks
Date: Thu, 25 Aug 2022 22:39:33 +0900
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Thanks; pushed to Emacs 29.  I had to apply the patches "by hand"
> instead of with "git am" because "git am" complained:

Thank you for applying the patches, and sorry for the inconvenience.
I'm going to review my email environment.

Regards,




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Sep 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 216 days ago.

Previous Next


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