From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: forward-comment and syntax-ppss Date: Sun, 5 Feb 2017 15:33:05 -0800 (PST) Message-ID: References: <83fd1db0-7362-6117-c5cd-715398c0dea4@gmail.com> <20161207220447.GA4503@acm.fritz.box> <20161208201517.GB3120@acm.fritz.box> <20161209190747.GC2203@acm.fritz.box> <5a70902f-882e-f616-74b2-df6eb81fc70c@yandex.ru> <20161211101715.GA14084@acm.fritz.box> <51c0554f-40d0-37a5-b134-17058343aa3f@yandex.ru> <20161216200630.GB3858@acm.fritz.box> <83r3576lxs.fsf@gnu.org> <838tre7gqt.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1486337643 13817 195.159.176.226 (5 Feb 2017 23:34:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2017 23:34:03 +0000 (UTC) To: Lars Ingebrigtsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 00:33:57 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caWJh-0003Gn-2N for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 00:33:57 +0100 Original-Received: from localhost ([::1]:44877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caWJm-0004Yd-Ds for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 18:34:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caWJ5-0004XN-FD for emacs-devel@gnu.org; Sun, 05 Feb 2017 18:33:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caWJ2-00007Y-Bh for emacs-devel@gnu.org; Sun, 05 Feb 2017 18:33:19 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:33254) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1caWJ2-00006K-2j for emacs-devel@gnu.org; Sun, 05 Feb 2017 18:33:16 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v15NXCcb001866 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 5 Feb 2017 23:33:13 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v15NXAZ7022074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 5 Feb 2017 23:33:10 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v15NX71I031337; Sun, 5 Feb 2017 23:33:08 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212008 Archived-At: > 3) Interactive narrowing should be stack-based, so that > you can easily narrow to things, do something, then > narrow some more, and then pop that narrowing to return > to the previous. It's something I have wanted for a > long time. Well, you have it. That's just what I showed with the `zones.el' code I use. See this message in the same thread: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00693.html and https://www.emacswiki.org/emacs/MultipleNarrowings for a general description. Just as you requested, when you narrow the buffer interactively (only), that narrowing (restriction, or "zone") is put on a stack. Only it's not just a stack. It's a ring. You can access it as a stack, a list, or a ring, or directly access (restore) any restriction by its identifier or its ring position. And markers are used for the restriction limits, so the zones adjust to text insertions and deletions. And don't think that the restrictions on the ring need to all be nested inside each other like russian dolls. They can each have any buffer limits. They can even be in different buffers (or not). And you can have any number of such rings at the same time. Though very simple, it is really quite useful, IMO. This message shows the code that pushes the restriction to the current ring: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00702.html It just advises `narrow-to-region' (which is defined in C). Of course, _use_ of the ring is not limited to interactive use. It is just automatic pushing to the ring that is done only interactively.