unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* GNUS utilities leak overlays
@ 2004-07-16  0:33 Peter Whaite
  2004-07-16 16:09 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Whaite @ 2004-07-16  0:33 UTC (permalink / raw)


I have already reported this to ding@gnus.org, but given the current
discussion about GNUS maintenance, then perhaps I should report it here
as well.  

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GNUS utilities leak overlays
  2004-07-16  0:33 GNUS utilities leak overlays Peter Whaite
@ 2004-07-16 16:09 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2004-07-16 16:09 UTC (permalink / raw)
  Cc: emacs-devel

Perhaps erase-buffer should delete all overlays in the buffer.
This would fit naturally with the general meaning of the command.
Would it break anything?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-16 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-16  0:33 GNUS utilities leak overlays Peter Whaite
2004-07-16 16:09 ` Richard Stallman

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).