diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-06-24 02:26:42 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-06-24 02:26:42 +0000 |
commit | 3f93569ba58cbbf64498d5da7a171aadc13a6aa3 (patch) | |
tree | 37b1792f94c9d3eaf08af91012cc9e411161a583 | |
parent | 8c107a69b7e5a0cab80fb6dde9fd195a9ed2c095 (diff) | |
download | emacs-3f93569ba58cbbf64498d5da7a171aadc13a6aa3.tar.gz |
(outline-discard-overlays): Don't use let inside a cycle.
-rw-r--r-- | lisp/textmodes/outline.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/textmodes/outline.el b/lisp/textmodes/outline.el index bf15f6186f0..f12518c4051 100644 --- a/lisp/textmodes/outline.el +++ b/lisp/textmodes/outline.el @@ -415,22 +415,25 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." (if (< end beg) (setq beg (prog1 end (setq end beg)))) (save-excursion - (let ((overlays (overlays-in beg end))) + (let ((overlays (overlays-in beg end)) + o + o1) (while overlays - (let ((o (car overlays))) - (if (overlay-get o prop) - ;; Either push this overlay outside beg...end - ;; or split it to exclude beg...end - ;; or delete it entirely (if it is contained in beg...end). - (if (< (overlay-start o) beg) - (if (> (overlay-end o) end) - (let ((o1 (outline-copy-overlay o))) - (move-overlay o1 (overlay-start o1) beg) - (move-overlay o end (overlay-end o))) - (move-overlay o (overlay-start o) beg)) + (setq o (car overlays)) + (if (overlay-get o prop) + ;; Either push this overlay outside beg...end + ;; or split it to exclude beg...end + ;; or delete it entirely (if it is contained in beg...end). + (if (< (overlay-start o) beg) (if (> (overlay-end o) end) - (move-overlay o end (overlay-end o)) - (delete-overlay o))))) + (progn + (setq o1 (outline-copy-overlay o)) + (move-overlay o1 (overlay-start o1) beg) + (move-overlay o end (overlay-end o))) + (move-overlay o (overlay-start o) beg)) + (if (> (overlay-end o) end) + (move-overlay o end (overlay-end o)) + (delete-overlay o)))) (setq overlays (cdr overlays)))))) ;; Make a copy of overlay O, with the same beginning, end and properties. |