From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Frazer Newsgroups: gmane.emacs.help Subject: Re: Is there a package which uses markers to guess how to remap line numbers? Date: Thu, 19 Nov 2009 10:39:34 -0500 Organization: Ye 'Ol Disorganized NNTPCache groupie Message-ID: <1258645173.827718@sj-nntpcache-2.cisco.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258647925 29286 80.91.229.12 (19 Nov 2009 16:25:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 16:25:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 17:25:18 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NB9oo-00069w-8v for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 17:25:14 +0100 Original-Received: from localhost ([127.0.0.1]:43671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NB9on-0003xs-F4 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 11:25:13 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe14.iad.POSTED!7564ea0f!not-for-mail User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) Original-Newsgroups: gnu.emacs.help In-Reply-To: Cache-Post-Path: sj-nntpcache-2.cisco.com!unknown@dhcp-64-102-76-113.cisco.com X-Cache: nntpcache 3.0.2 (see http://www.nntpcache.com/) Original-Lines: 33 Original-X-Complaints-To: newsadmin@cisco.com Original-NNTP-Posting-Date: Thu, 19 Nov 2009 15:39:34 UTC Original-Xref: news.stanford.edu gnu.emacs.help:174859 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69932 Archived-At: rocky wrote: > I am writing a package (an interface to debuggers) that sets markers > on various lines (e.g. the lines at which the debugger stops at). Over > time, the buffer (source code) can change and the markers move around > with that. This is good. > > Is there however a package which will suggest after buffer > modification how a particular line number might have changed given the > existing marker information and associated line number information for > that buffer? > > Here is a concrete example. Let's say I have a buffer with a marker at > lines 1, 5, 10 and 20. Let's say the marker for 10 moves to line 11 > after modification but not the one for 1, 5 or 20. > > If I ask about lines in the range 2-4, I may warn that overall the > buffer has changed but possibly not the one in that range. Of course > if I ask about lines 1, 5, or 20, I can warn that although the buffer > has changed, (parts of) those lines haven't. If I ask about a line in > the range 6-19 I can suggest there may be a move ahead a line with > more certainty of line 10. > > Has anyone thought about this problem. Does such a package exist or > has anything like this been done as part of an existing package? > What I have done for something similar is when the buffer is saved (or modified or whatever in your case) that I simply blow away all information that I am keeping about line numbers in this buffer and repopulate it by iterating over the markers (overlays in my case) and putting in the new line numbers. Scott