From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Whaite Newsgroups: gmane.emacs.devel Subject: Should overlays evaporate by default? Date: Tue, 10 May 2005 11:56:51 -0400 Message-ID: <200505101556.j4AFupmb015431@brains.moreideas.ca> References: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1115740658 15268 80.91.229.2 (10 May 2005 15:57:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 May 2005 15:57:38 +0000 (UTC) Cc: bob@rattlesnake.com, Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 10 17:57:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DVX5D-0004kI-Mu for ged-emacs-devel@m.gmane.org; Tue, 10 May 2005 17:55:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVXDm-0001Zq-9R for ged-emacs-devel@m.gmane.org; Tue, 10 May 2005 12:04:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DVXCt-0001S7-FV for emacs-devel@gnu.org; Tue, 10 May 2005 12:03:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DVXCo-0001Og-Mh for emacs-devel@gnu.org; Tue, 10 May 2005 12:03:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVXCm-0001Ix-QG for emacs-devel@gnu.org; Tue, 10 May 2005 12:03:32 -0400 Original-Received: from [209.5.194.99] (helo=berlinr.sprint.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DVXDM-0001kb-Eb for emacs-devel@gnu.org; Tue, 10 May 2005 12:04:08 -0400 Original-Received: from brains.moreideas.ca ([149.99.128.187]) by berlinr.sprint.ca (InterMail vM.5.01.02.00 201-253-122-103-101-20001108) with ESMTP id <20050510155739.SDFS5998.berlinr.sprint.ca@brains.moreideas.ca>; Tue, 10 May 2005 11:57:39 -0400 Original-Received: from brains.moreideas.ca (localhost.localdomain [127.0.0.1]) by brains.moreideas.ca (8.12.8/8.12.8) with ESMTP id j4AFurXW015703; Tue, 10 May 2005 11:56:53 -0400 Original-Received: from brains.moreideas.ca (peta@localhost) by brains.moreideas.ca (8.12.8/8.12.8/Submit) with ESMTP id j4AFupmb015431; Tue, 10 May 2005 11:56:51 -0400 Original-To: emacs-devel@gnu.org In-Reply-To: Message from "Robert J. Chassell" of "Tue, 10 May 2005 11:04:14 -0000." X-Mailer: MH-E 7.82+cvs; nmh 1.0.4; GNU Emacs 22.0.50.54 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:36949 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36949 Robert J. Chassell wrote: > [After running the same RMAIL for several days, deletions slow; but > they do not slow the first day.] > > Success so far! > > On 6 May 2005, Stefan Monnier said > > Maybe we just need to make goto-address mark its overlay with the > `evaporate' propert so they disappear as soon as they beomce > empty. > > and provided a patch. Last year I reported a similar problem with mh-e (see below). Perhaps it would be better for overlays to evaporate by default. I can only think of one case where its not better, and that's where the contents of an editable field are deleted and new contents reinserted. If the overlay evaporates the field disappears, but the bug is immediately obvious and quickly fixed. On the other hand, for the case where overlays are used to decorate buffer contents, the consequence (massive memory leakage) is not obvious, and goes undetected. I suspect that this case is far more common. For reference here is what I said back on 15 July 2004: > > MH-E uses parts of GNUS to display messages, and the overlays used by > GNUS do not have the evaporate property set, and so do not get deleted > when the mh-show buffer is erased in preparation for the next message > (see below). > > Yes MH-E, and any other packages that use these utilities, could be > changed to explicitly delete overlays when reusing buffers, but it would > be easier for maintainers and future package writers if the GNUS > overlays would evaporate. > > It would not surprise me if other packages using overlays to decorate > buffer contents also leak. > > The real problem is that anyone using overlays to decorate the contents > of a reusable buffer is required to know that they must either > explicitly set the evaporate property on any overlays they create, or > explicitly delete overlays when using erase-buffer, or both. > > This requirement is not obvious. There should be a note in the > erase-buffer documentation pointing out that only overlays with the > evaporate property will be deleted, and with a reference to the new > remove-overlays function. > > I think it preferable that erase-buffer also remove the overlays. Right > now it results in _all_ the non-evaporating overlays being reduced to > zero length at the begining of the buffer. Inserting text into the > buffer cannot ressurect them unless they have a non-default end > advance behaviour. I guess erase-buffer could be selective about which > overlays it removes, but that sounds like overkill as I doubt anyone > intentionally uses overlays and erase-buffer that way. > > Here is the result of my tests on the MH-E message show buffer after > using it to browse several email messages... > > (pp (save-current-buffer > (set-buffer (get-buffer-create "show-+inbox")) > (mapcar (lambda (ov) (list (overlay-start ov) (overlay-end ov) > (overlay-properties ov))) > (overlays-in (point-min) (point-max))) > )) > > Overlays used in current message... > > ((515 558 > (face gnus-cite-face-2)) > (443 512 > (face gnus-cite-face-2)) > (378 437 > (face gnus-cite-face-2)) > (302 374 > (face gnus-cite-attribution-face)) > (302 374 > (face gnus-cite-face-2)) > > Overlays used in previous messages... > > (1 1 > (face gnus-cite-face-2)) > (1 1 > (face gnus-cite-face-2)) > (1 1 > (face gnus-cite-attribution-face)) > (1 1 > (face gnus-cite-face-3)) > (1 1 > (keymap > (keymap > (mouse-2 . smiley-mouse-toggle-buffer) > (down-mouse-2 . ignore)) > help-echo "mouse-2: toggle smilies in buffer" smiley t mouse-face highlight display > (when smiley-active image :type pbm :file "/usr/local/share/emacs/21.3.50/lisp/gnus/smile.pbm" :ascent center))) > (face gnus-cite-face-2)) > > ...and many, many, more > ) -- Peter Whaite (http://whaite.ca)