summaryrefslogtreecommitdiff
path: root/lisp/progmodes/hideshow.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-08-02 21:21:23 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-08-02 21:21:23 +0200
commit1b82cc0105994e638766ba864654add6935fa508 (patch)
tree83e19ff2399e9674598165f3f9be55c1f9fe2b94 /lisp/progmodes/hideshow.el
parent0393cd2f721f8e44b4cef3b0864f1b4903ab9ba3 (diff)
downloademacs-1b82cc0105994e638766ba864654add6935fa508.tar.gz
Fix progression in hideshow.el
* lisp/progmodes/hideshow.el (hs-hide-all): Ensure progression in a less brittle fashion (bug#19892).
Diffstat (limited to 'lisp/progmodes/hideshow.el')
-rw-r--r--lisp/progmodes/hideshow.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 4cfcd3d09a3..0fb5c555125 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -806,7 +806,8 @@ If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments."
(hs-hide-block-at-point t))
;; Go to end of matched data to prevent from getting stuck
;; with an endless loop.
- (goto-char (match-end 0))))
+ (when (looking-at hs-block-start-regexp)
+ (goto-char (match-end 0)))))
;; found a comment, probably
(let ((c-reg (hs-inside-comment-p)))
(when (and c-reg (car c-reg))