unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: kobarity <kobarity@gmail.com>
To: lorniu <lorniu@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 71170@debbugs.gnu.org
Subject: bug#71170: 30.0.50; hs-hide-all in python mode not works as expected
Date: Sun, 26 May 2024 14:10:35 +0900	[thread overview]
Message-ID: <eke7v831yx84.wl-kobarity@gmail.com> (raw)
In-Reply-To: <87wmnh6vbs.fsf@gmail.com>

lorniu wrote:
> 
> 
> Maybe patch like this can avoid too much newlines between hidden blocks.
> 
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 79e383a1c1a..26546df13c4 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -5734,7 +5734,12 @@ 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-block))
> +  (python-nav-end-of-block)
> +  (end-of-line)
> +  (let ((pt (point)))
> +    (skip-chars-forward " \n\t")
> +    (re-search-backward "\n\n" nil t)
> +    (when (< (point) pt) (goto-char pt))))
> 
> -- 
> Mess.

It seems this patch hides like this:

```
   if TYPE_CHECKING:...else:...

   class aaa:...
```

Is this what you want?  I think it is overkill to put if and else on
one line.





  reply	other threads:[~2024-05-26  5:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24  8:40 bug#71170: 30.0.50; hs-hide-all in python mode not works as expected lorniu
2024-05-25 10:28 ` Eli Zaretskii
2024-05-25 14:36   ` kobarity
2024-05-26  4:39     ` lorniu
2024-05-26  5:10       ` kobarity [this message]
     [not found]         ` <87fru512ne.fsf@gmail.com>
2024-05-26  8:31           ` kobarity
2024-05-26  8:51             ` lorniu
2024-05-26  9:05               ` kobarity
2024-06-08 11:54                 ` Eli Zaretskii
2024-06-08 15:22                   ` kobarity
2024-06-09 13:50                     ` Eli Zaretskii

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=eke7v831yx84.wl-kobarity@gmail.com \
    --to=kobarity@gmail.com \
    --cc=71170@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=lorniu@gmail.com \
    /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).