]> git.eshelyaron.com Git - emacs.git/commit
Add Python blocks support for hideshow
authorkobarity <kobarity@gmail.com>
Wed, 17 Aug 2022 10:44:56 +0000 (12:44 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 17 Aug 2022 10:44:56 +0000 (12:44 +0200)
commitaf4cfb519415ed3c1d6d036aac908e4f9ee383eb
treeaa03cf5584fee7e15fa62743ee5852caac6d88b3
parent8f784a27667fbebdf320388ef2ec46ae67f69230
Add Python blocks support for hideshow

* lisp/progmodes/python.el (python-nav-beginning-of-block-regexp):
New variable.
(python-hideshow-forward-sexp-function): Change to call
`python-nav-end-of-block'.
(python-hideshow-find-next-block): New function to be used as
FIND-NEXT-BLOCK-FUNC in `hs-special-modes-alist'.
(python-info-looking-at-beginning-of-block): New function to be
used as LOOKING-AT-BLOCK-START-P-FUNC in `hs-special-modes-alist'.
(python-mode): Change settings of `hs-special-modes-alist'.

* test/lisp/progmodes/python-tests.el
(python-hideshow-hide-levels-1): Fix to keep empty lines.
(python-info-looking-at-beginning-of-block-1)
(python-hideshow-hide-levels-3, python-hideshow-hide-levels-4)
(python-hideshow-hide-all-1, python-hideshow-hide-all-2)
(python-hideshow-hide-all-3, python-hideshow-hide-block-1): New
tests (bug#56635).
lisp/progmodes/python.el
test/lisp/progmodes/python-tests.el