unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: whitespace.el does not seem to delete its overlays
Date: Fri, 08 Apr 2005 10:46:18 -0400	[thread overview]
Message-ID: <m1hdihjpjq.fsf-monnier+emacs@gnu.org> (raw)
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)")

> 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	other threads:[~2005-04-08 14:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08 13:43 whitespace.el does not seem to delete its overlays Stephan Stahl
2005-04-08 14:46 ` Stefan Monnier [this message]
2005-04-08 22:57   ` Stephan Stahl
2005-04-09  3:38 ` Richard Stallman
2005-04-09  8:05   ` Stephan Stahl
2005-04-10  1:55     ` Richard Stallman
2005-04-10 12:04       ` Stephan Stahl
2005-04-11  1:56         ` Richard Stallman
2005-04-11  6:13           ` Stephan Stahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1hdihjpjq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).