;;; Emacs 21 backward compatibility defines (unless (fboundp 'remove-overlays) (defun remove-overlays (&optional beg end name val) "Clear BEG and END of overlays whose property NAME has value VAL. Overlays might be moved and or split. " ;; Stolen from planner as planner-remove-overlays (if (< end beg) (setq beg (prog1 end (setq end beg)))) (save-excursion (dolist (o (overlays-in beg end)) (when (eq (overlay-get o name) val) ;; 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) (progn (move-overlay (planner-copy-overlay o) (overlay-start o) 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)))))))) (provide 'lui-e21)