From 1b82cc0105994e638766ba864654add6935fa508 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 2 Aug 2019 21:21:23 +0200 Subject: [PATCH] Fix progression in hideshow.el * lisp/progmodes/hideshow.el (hs-hide-all): Ensure progression in a less brittle fashion (bug#19892). --- lisp/progmodes/hideshow.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) -- 2.39.2