GNU bug report logs -
#56635
29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks
Previous Next
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.
Full log
View this message in rfc822 format
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.
This bug report was last modified 2 years and 266 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.