summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/hideshow.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index f9608a0d7c9..094c4499b75 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -334,14 +334,13 @@ what kind of block it is suppose to hide."
(setq beg (prog1 end (setq end beg))))
(save-excursion
(goto-char beg)
- (while (< (point) end)
- (let ((overlays (overlays-at (point))))
- (while overlays
- (let ((o (car overlays)))
- (if (eq (overlay-get o prop) value)
- (delete-overlay o)))
- (setq overlays (cdr overlays))))
- (goto-char (next-overlay-change (point))))))
+ (let ((overlays (overlays-in beg end))
+ o)
+ (while overlays
+ (setq o (car overlays))
+ (if (eq (overlay-get o prop) value)
+ (delete-overlay o))
+ (setq overlays (cdr overlays))))))
(defun hs-hide-block-at-point (&optional end comment-reg)
"Hide block iff on block beginning, optional END means reposition at end.