]> git.eshelyaron.com Git - emacs.git/commit
hideshow.el: Improve hs-toggle-hiding behavior
authorkobarity <kobarity@gmail.com>
Mon, 19 Sep 2022 04:43:33 +0000 (13:43 +0900)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Sep 2022 15:08:29 +0000 (11:08 -0400)
commit2084f4ada38c3ebaaf77806f32a79073fc9f0bf4
treefb0596eef73a61c20328683ee64b14507b5113d4
parentc1cead89f5f230d9bd10da54f0e959d2570a037b
hideshow.el: Improve hs-toggle-hiding behavior

* lisp/progmodes/hideshow.el
(hs-find-block-beginning-match): New function to be used in
`hs-already-hidden-p'.
(hs-already-hidden-p): Add check if beginning of line is inside a
block.
(hs-toggle-hiding): Don't change to selected-window's buffer when
event arg is absent.

* test/lisp/progmodes/hideshow-tests.el
(hideshow-tests-with-temp-buffer-selected): New helper macro.
(hideshow-tests-make-event-at): New helper function.
(hideshow-already-hidden-p-1): New test.
(hideshow-toggle-hiding-1): New test.
(hideshow-mouse-toggle-hiding-1): New test (bug#52092).
lisp/progmodes/hideshow.el
test/lisp/progmodes/hideshow-tests.el