From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard M Stallman Newsgroups: gmane.emacs.devel Subject: Re: map-file-lines Date: Thu, 05 Feb 2009 00:40:40 -0500 Message-ID: References: <86fxiuw6u7.fsf@lifelogs.com> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1233812662 25691 80.91.229.12 (5 Feb 2009 05:44:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 05:44:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 05 06:45:34 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LUx3M-0004wd-M1 for ged-emacs-devel@m.gmane.org; Thu, 05 Feb 2009 06:45:32 +0100 Original-Received: from localhost ([127.0.0.1]:41592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUx23-0004v2-QQ for ged-emacs-devel@m.gmane.org; Thu, 05 Feb 2009 00:44:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUx0T-0003me-NE for emacs-devel@gnu.org; Thu, 05 Feb 2009 00:42:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUx0S-0003m0-ME for emacs-devel@gnu.org; Thu, 05 Feb 2009 00:42:32 -0500 Original-Received: from [199.232.76.173] (port=41418 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUx0S-0003lp-F9 for emacs-devel@gnu.org; Thu, 05 Feb 2009 00:42:32 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:40268) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LUx0S-0007w9-4o for emacs-devel@gnu.org; Thu, 05 Feb 2009 00:42:32 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LUwye-0001fA-Qe; Thu, 05 Feb 2009 00:40:40 -0500 In-reply-to: <86fxiuw6u7.fsf@lifelogs.com> (message from Ted Zlatanov on Wed, 04 Feb 2009 09:38:08 -0600) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:108774 Archived-At: This is essentially mapping byte offsets to line positions, with extra calculations. As Stefan suggested, it's better to just use byte offsets. The main point of my message is the UI proposal. You're right that it's good to use byte offsets. I had not thought about that, but it could be done by specifying the -b option for grep. Otherwise I think your suggestions are similar to mine: set up a special mode where the buffer is a window[1] into the file instead of the whole file, and create special commands to move the window back and forth. I proposed a specific UI for specifying which part of the file to edit, one I think will be convenient.