changeset 18428:5ec58687160a

(hs-discard-overlays): Use overlays-in to get all the overlays in a range. Don't use let inside a cycle.
author Richard M. Stallman <rms@gnu.org>
date Tue, 24 Jun 1997 02:26:57 +0000
parents 170b16201f82
children 8326843eefd9
files lisp/progmodes/hideshow.el
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/hideshow.el	Tue Jun 24 02:26:42 1997 +0000
+++ b/lisp/progmodes/hideshow.el	Tue Jun 24 02:26:57 1997 +0000
@@ -334,14 +334,13 @@
       (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.