From: John Foerch Date: Tue, 7 Dec 2010 22:13:51 +0000 (-0500) Subject: more thorough job of deleting old overlays on startup X-Git-Tag: v0.1~10 X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=da960bad95cbb37155e9ec46f8bfdc66f0131bf9;p=visible-mark more thorough job of deleting old overlays on startup Before this patch, revert-buffer caused stale overlays to not get cleaned up because it depended on visible-mark-overlays being valid. However, reverting the buffer wipes out local variables. --- diff --git a/visible-mark.el b/visible-mark.el index 8bc719a..9318403 100644 --- a/visible-mark.el +++ b/visible-mark.el @@ -67,7 +67,11 @@ :type '(repeat regexp)) (defun visible-mark-initialize-overlays () - (mapc 'delete-overlay visible-mark-overlays) + (mapc + (lambda (x) + (when (eq 'visible-mark (overlay-get x 'category)) + (delete-overlay x))) + (overlays-in (point-min) (point-max))) (let (overlays) (dotimes (i visible-mark-max) (let ((overlay (make-overlay (point-min) (point-min))))