diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-06-24 02:26:57 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-06-24 02:26:57 +0000 |
commit | c8793f27946816f74e5a4e2d4085910c40bb6791 (patch) | |
tree | 0288abfa5da2ba82e03e33cd4d6489a60f1f15d2 | |
parent | 3f93569ba58cbbf64498d5da7a171aadc13a6aa3 (diff) | |
download | emacs-c8793f27946816f74e5a4e2d4085910c40bb6791.tar.gz |
(hs-discard-overlays): Use overlays-in to
get all the overlays in a range. Don't use let inside a cycle.
-rw-r--r-- | lisp/progmodes/hideshow.el | 15 |
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. |