emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: whitespace.el does not seem to delete its overlays


From: Stefan Monnier
Subject: Re: whitespace.el does not seem to delete its overlays
Date: Fri, 08 Apr 2005 10:46:18 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

> whitespace-buffer does not delete its overlays but adds more and more
> onto the buffer.

I believe the patch below fixes it.  I've installed it in the CVS, please
try it out and tell me if it helps,


        Stefan


Index: whitespace.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/whitespace.el,v
retrieving revision 1.31
diff -u -u -b -r1.31 whitespace.el
--- whitespace.el       8 Apr 2005 14:26:13 -0000       1.31
+++ whitespace.el       8 Apr 2005 14:40:33 -0000
@@ -736,12 +732,10 @@
 (defun whitespace-highlight-the-space (b e)
   "Highlight the current line, unhighlighting a previously jumped to line."
   (if whitespace-display-spaces-in-color
-      (progn
+      (let ((ol (whitespace-make-overlay b e)))
        (whitespace-unhighlight-the-space)
-       (add-to-list 'whitespace-highlighted-space
-                    (whitespace-make-overlay b e))
-       (whitespace-overlay-put (whitespace-make-overlay b e) 'face
-                               'whitespace-highlight-face))))
+       (push ol whitespace-highlighted-space)
+       (whitespace-overlay-put ol 'face 'whitespace-highlight-face))))
 ;;  (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space))
 
 (defun whitespace-unhighlight-the-space ()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]