From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rocky 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 18:10:02 -0800 (PST) Organization: http://groups.google.com Message-ID: <9f511283-d915-434b-b18b-a4546a008d16@d21g2000yqn.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1258684853 29606 80.91.229.12 (20 Nov 2009 02:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2009 02:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 20 03:40:46 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 1NBJQU-0005fz-1D for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Nov 2009 03:40:46 +0100 Original-Received: from localhost ([127.0.0.1]:58286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBJQT-0000k1-Ca for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 21:40:45 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!d21g2000yqn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-NNTP-Posting-Host: 71.183.236.17 Original-X-Trace: posting.google.com 1258683002 9337 127.0.0.1 (20 Nov 2009 02:10:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 20 Nov 2009 02:10:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d21g2000yqn.googlegroups.com; posting-host=71.183.236.17; posting-account=jKjGDQoAAABKN2iauJtD3DV5oMZpXuQo User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15 GTB5, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:174881 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:69952 Archived-At: On Nov 19, 10:25=A0am, des...@verizon.net wrote: > rocky writes: > > 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 > > existingmarkerinformation and associated line number information for > > that buffer? > > > Here is a concrete example. Let's say I have a buffer with amarkerat > > lines 1, 5, 10 and 20. Let's say themarkerfor 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? > > Part of the compile package does something like that. > As you do "next-error" it accounts for any fixes you may have made > for previous errors. Thanks for the suggestion. I looked at compile.el. It seems to be to parse all of the error messages in the compilation buffer and set markers for each of those locations referred to. That is why it can track edits. The difference here is that we are interactive, so I don't know in advance all of the lines that might be stopped at. Assuming a debugger that only reports line positions and nothing finer grained, I could set marks at every line in the file, or better sets marks at every stoppable line in the file (i.e. the lines that you can set a breakpoint on). However I suspect that will be too slow and/or use lots of memory. But perhaps not - we'll see.