From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: widen-one-level [was: Emacs's handling of line numbers] Date: Mon, 19 Apr 2010 15:56:52 -0700 Message-ID: <3676E4223C3843A8B6AFF8A2B1589065@us.oracle.com> References: <837ho6czb6.fsf@gnu.org> <8339yucbsg.fsf@gnu.org> <83wrw5bxkc.fsf@gnu.org><90D3EB66AA37491881EB2B26100925C2@us.oracle.com><7DAA22BBC7FD45D9996D3EE994E01C16@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1271717891 19716 80.91.229.12 (19 Apr 2010 22:58:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Apr 2010 22:58:11 +0000 (UTC) To: "'Leo'" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 20 00:58:06 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O3zul-0000fN-JD for ged-emacs-devel@m.gmane.org; Tue, 20 Apr 2010 00:58:05 +0200 Original-Received: from localhost ([127.0.0.1]:47156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3zuj-0007dH-C0 for ged-emacs-devel@m.gmane.org; Mon, 19 Apr 2010 18:58:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O3zuE-0007T4-Vb for emacs-devel@gnu.org; Mon, 19 Apr 2010 18:57:31 -0400 Original-Received: from [140.186.70.92] (port=50416 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3zuD-0007S8-78 for emacs-devel@gnu.org; Mon, 19 Apr 2010 18:57:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O3zuB-0002cK-AT for emacs-devel@gnu.org; Mon, 19 Apr 2010 18:57:29 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:64894) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3zuB-0002c3-2w for emacs-devel@gnu.org; Mon, 19 Apr 2010 18:57:27 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o3JMvNUr026809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Apr 2010 22:57:24 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o3JMvMwC020959; Mon, 19 Apr 2010 22:57:22 GMT Original-Received: from abhmt004.oracle.com by acsmt353.oracle.com with ESMTP id 189248441271717810; Mon, 19 Apr 2010 15:56:50 -0700 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Apr 2010 15:56:50 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: Acrf67y41+5IMn75TZm6EN96yYHwHQAAPi7A X-Auth-Type: Internal IP X-Source-IP: rcsinet15.oracle.com [148.87.113.117] X-CT-RefId: str=0001.0A090205.4BCCDFD4.0217:SCFMA4539811,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:123893 Archived-At: > My original idea was to implement some sort of undo for > narrowing using a ring structure and have narrow-to-region > record that info for me. Because of this (which I think is ugly) > I abandoned the plan. > > In the end I implemented something that needs a user to explicitly > record the state (bound to C-x n r). > > The use case for me is this: suppose I am writing an around 50 page > article in LaTeX and I don't feel like splitting it into > multiple files. > But during writing I only want to focus on a portion of the article (a > section for example), I can narrow to that section and record that > state so that C-x n w will not expose me to the entire file. > > I posted my code here http://paste.lisp.org/display/97993. I think the code I posted does what you describe above for your use case, and you can use it with regular narrowing and widening. Each buffer has its own ring of restrictions. Also, if you use bookmark+.el then you can also bookmark regions, IOW, have persistence. Dunno, but it sounds like that too could be helpful for your use case.