aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorElías Gabriel Pérez2025-12-05 18:42:54 -0600
committerJuri Linkov2025-12-08 09:20:29 +0200
commita582f2bb577bd8e696d51e4d3a728426b33f59cc (patch)
tree8df49b01d83eee0152149f4dac5bd3faa5579c5f /test/lisp/progmodes/python-tests.el
parent15f9050ce5c21d1c7d455db90443ddb4124641aa (diff)
downloademacs-a582f2bb577bd8e696d51e4d3a728426b33f59cc.tar.gz
emacs-a582f2bb577bd8e696d51e4d3a728426b33f59cc.zip
hideshow: Deep cleaning. (Bug#79934)
This is just a refactoring change, simplifying most of the code and commentaries and removing/deprecating redundant code. * etc/NEWS: Announce changes. * lisp/progmodes/hideshow.el (hs-hide-hook, hs-show-hook): Use 'defcustom' instead of 'defvar'. (hs-block-end-regexp, hs-forward-sexp-function) (hs-adjust-block-beginning-function) (hs-adjust-block-end-function, hs-find-block-beginning-function) (hs-find-next-block-function) (hs-looking-at-block-start-predicate) (hs-inside-comment-predicate): Update docstring. (hs-discard-overlays): Simplify. (hs-life-goes-on): Update docstring. (hs-hideable-region-p): Revert previous changes. (hs-overlay-at): Simplify. (hs-make-overlay): Fix performance. (hs-block-positions): Rework. (hs--add-indicators): Fix performance. (hs-isearch-show-temporary): Simplify. (hs-looking-at-block-start-p): Rename ... (hs-looking-at-block-start-p--default): ... to this. (hs-forward-sexp, hs-hide-comment-region): Mark as obsolete. (hs-hide-block-at-point): Rework. (hs-get-first-block): Rename ... (hs-get-first-block-on-line): ... to this. (hs-inside-comment-p--default): Rework. (hs-find-block-beginning): Rename ... (hs-find-block-beg-fn--default): ... to this. (hs-find-next-block): Rename ... (hs-find-next-block-fn--default): ... to this. (hs-hide-level-recursive): Rework. (hs-find-block-beginning-match): Remove function. (hs-already-hidden-p): Simplify. (hs-c-like-adjust-block-beginning): Mark as obsolete. (hs-hide-all, hs-show-all, hs-hide-block, hs-show-block) (hs-hide-level, hs-hide-initial-comment-block, hs-cycle): Simplify. * test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1) (hideshow-hide-level-2): * test/lisp/progmodes/python-tests.el (python-hideshow-hide-levels-3, python-hideshow-hide-levels-4): * test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1) (hideshow-hide-level-2): * test/lisp/progmodes/python-tests.el (python-hideshow-hide-levels-3, python-hideshow-hide-levels-4): Update tests.
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index b9130da495d..6ddd57c9db2 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -7428,7 +7428,7 @@ class SomeClass:
7428 (or enabled (hs-minor-mode -1))))) 7428 (or enabled (hs-minor-mode -1)))))
7429 7429
7430(ert-deftest python-hideshow-hide-levels-3 () 7430(ert-deftest python-hideshow-hide-levels-3 ()
7431 "Should hide all blocks." 7431 "Should hide 2nd level blocks."
7432 (python-tests-with-temp-buffer 7432 (python-tests-with-temp-buffer
7433 " 7433 "
7434def f(): 7434def f():
@@ -7447,19 +7447,22 @@ def g():
7447 (python-tests-visible-string) 7447 (python-tests-visible-string)
7448 " 7448 "
7449def f(): 7449def f():
7450 if 0:
7450 7451
7451def g(): 7452def g():
7453 pass
7452")))) 7454"))))
7453 7455
7454(ert-deftest python-hideshow-hide-levels-4 () 7456(ert-deftest python-hideshow-hide-levels-4 ()
7455 "Should hide 2nd level block." 7457 "Should hide 3nd level block."
7456 (python-tests-with-temp-buffer 7458 (python-tests-with-temp-buffer
7457 " 7459 "
7458def f(): 7460def f():
7459 if 0: 7461 if 0:
7460 l = [i for i in range(5) 7462 l = [i for i in range(5)
7461 if i < 3] 7463 if i < 3]
7462 abc = o.match(1, 2, 3) 7464 if 1:
7465 abc = o.match(1, 2, 3)
7463 7466
7464def g(): 7467def g():
7465 pass 7468 pass
@@ -7472,6 +7475,9 @@ def g():
7472 " 7475 "
7473def f(): 7476def f():
7474 if 0: 7477 if 0:
7478 l = [i for i in range(5)
7479 if i < 3]
7480 if 1:
7475 7481
7476def g(): 7482def g():
7477 pass 7483 pass