From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: whitespace.el does not seem to delete its overlays Date: Fri, 08 Apr 2005 10:46:18 -0400 Message-ID: References: <61435.217.194.34.123.1112967791.squirrel@wwws.franken.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1112972316 29071 80.91.229.2 (8 Apr 2005 14:58:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2005 14:58:36 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 08 16:58:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DJuvp-0001pM-FY for ged-emacs-devel@m.gmane.org; Fri, 08 Apr 2005 16:58:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJuVL-0006Zh-VM for ged-emacs-devel@m.gmane.org; Fri, 08 Apr 2005 10:30:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DJuRi-0005G4-TA for emacs-devel@gnu.org; Fri, 08 Apr 2005 10:26:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DJuRV-0005Ab-7c for emacs-devel@gnu.org; Fri, 08 Apr 2005 10:26:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJuRR-00054Q-H0 for emacs-devel@gnu.org; Fri, 08 Apr 2005 10:26:37 -0400 Original-Received: from [206.47.199.166] (helo=simmts8-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DJulN-0004hP-Tj for emacs-devel@gnu.org; Fri, 08 Apr 2005 10:47:14 -0400 Original-Received: from empanada.home ([67.68.217.126]) by simmts8-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050408144619.YXYQ1623.simmts8-srv.bellnexxia.net@empanada.home>; Fri, 8 Apr 2005 10:46:19 -0400 Original-Received: by empanada.home (Postfix, from userid 502) id E01204D7653; Fri, 8 Apr 2005 10:46:18 -0400 (EDT) Original-To: "Stephan Stahl" In-Reply-To: <61435.217.194.34.123.1112967791.squirrel@wwws.franken.de> (Stephan Stahl's message of "Fri, 8 Apr 2005 15:43:11 +0200 (CEST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35766 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35766 > 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 ()