diff options
| author | Richard M. Stallman | 1997-06-24 02:26:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-24 02:26:57 +0000 |
| commit | e863e26439fb8e844e218ce21da41cd748cef904 (patch) | |
| tree | bde4db41c6653935446535d7c3b417fd2a1e9008 | |
| parent | 24b96659f1674e997bff907bec06a64f701d5edc (diff) | |
| download | emacs-e863e26439fb8e844e218ce21da41cd748cef904.tar.gz emacs-e863e26439fb8e844e218ce21da41cd748cef904.zip | |
(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." | |||
| 334 | (setq beg (prog1 end (setq end beg)))) | 334 | (setq beg (prog1 end (setq end beg)))) |
| 335 | (save-excursion | 335 | (save-excursion |
| 336 | (goto-char beg) | 336 | (goto-char beg) |
| 337 | (while (< (point) end) | 337 | (let ((overlays (overlays-in beg end)) |
| 338 | (let ((overlays (overlays-at (point)))) | 338 | o) |
| 339 | (while overlays | 339 | (while overlays |
| 340 | (let ((o (car overlays))) | 340 | (setq o (car overlays)) |
| 341 | (if (eq (overlay-get o prop) value) | 341 | (if (eq (overlay-get o prop) value) |
| 342 | (delete-overlay o))) | 342 | (delete-overlay o)) |
| 343 | (setq overlays (cdr overlays)))) | 343 | (setq overlays (cdr overlays)))))) |
| 344 | (goto-char (next-overlay-change (point)))))) | ||
| 345 | 344 | ||
| 346 | (defun hs-hide-block-at-point (&optional end comment-reg) | 345 | (defun hs-hide-block-at-point (&optional end comment-reg) |
| 347 | "Hide block iff on block beginning, optional END means reposition at end. | 346 | "Hide block iff on block beginning, optional END means reposition at end. |