From xemacs-m  Wed Jan 15 15:07:04 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id PAA24275 for <XEmacs-Beta@xemacs.org>; Wed, 15 Jan 1997 15:06:57 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQbyqm03597; Wed, 15 Jan 1997 16:06:50 -0500 (EST)
Date: Wed, 15 Jan 1997 16:06:50 -0500 (EST)
Message-Id: <QQbyqm03597.199701152106@crystal.WonderWorks.COM>
From: =?ISO-8859-1?Q?Kyle_Jones?= <kyle_jones@wonderworks.com>
To: nuspl@purdue.edu
Cc: XEmacs-Beta@xemacs.org
Subject: overlays
In-Reply-To: <199701151845.NAA25601@nvwls.cc.purdue.edu>
References: <199701151845.NAA25601@nvwls.cc.purdue.edu>

Joe Nuspl writes:
 > 
 > I have changed the overlay package so that it does not use the
 > obsolete mechanism.
 > 
 > I would like some input on the following points:
 > 
 > 1) overlay-buffer returns the buffer that the overlay (extent) is in,
 >    but extents can be over strings or buffers.  There are two ways of
 >    implemented the function:
 > 
 > 	(defalias 'overlay-buffer 'extent-object)
 > 
 >    -or-
 > 
 > 	(defun overlay-buffer (ov)
 > 	  (let (obj)
 > 	    (if (not (bufferp (setq obj (extent-object ov))))
 > 		(setq obj nil))
 > 	  obj))

I recommend the latter.  Consider

(set-buffer (overlay-buffer overlay))

If a string is returned by overlay-buffer, you might get an error
if you're lucky.  If you're unlucky, the string returned will
name an existing buffer and the result could be a disaster.

 > 2) overlays have a concept of a center point, overlays-in
 >    returns two lists, one with all of the overlays before the
 >    center point and one with all those after the point.  The
 >    Gnu Emacs buffer structure has a member, overlay_center,
 >    that contains the point.  I thought of making a buffer
 >    local variable for this.
 >
 > 3) Should this be something that is required or that is dumped?

Required, if compatibility is a goal.  I have code:

	       ;; No luck.  Search the lists returned by
	       ;; overlay-lists.  Use overlays-recenter so we only
	       ;; have to search the `after' lobe of the return
	       ;; value.
	       (overlay-recenter (1- pos))
	       (setq o-lists (overlay-lists))
	       (setq o-list (cdr o-lists))

There is no try.

