]> git.eshelyaron.com Git - emacs.git/commit
Add Python blocks support for hideshow
authorkobarity <kobarity@gmail.com>
Thu, 25 Aug 2022 12:29:10 +0000 (14:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 25 Aug 2022 12:29:10 +0000 (14:29 +0200)
commit7c7fc8fa5be69ccbfd2d134a899cdedf29d25aab
tree19f958616988d8f04851d20838ffeefbab3613e7
parent74d0304ad446dbad6fed887784ffbc3d0fdb59fd
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