From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#17401: 24.4.50; Narrow to {region,page,defun} in an indirect clone buffer in the other window Date: Fri, 18 Sep 2020 16:02:27 +0000 (UTC) Message-ID: References: <53661891.40206@orcon.net.nz> <87ft7fgpbm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4777"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 17401@debbugs.gnu.org, contact@zaneashby.co.nz To: Lars Ingebrigtsen , Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 18 18:11:43 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJIz9-00016e-QU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 18:11:43 +0200 Original-Received: from localhost ([::1]:54050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJIz8-0003t2-PZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 12:11:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJIqk-000177-Bo for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 12:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJIqk-0001xI-0U for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 12:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJIqj-00084Y-Tt for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 12:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Sep 2020 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17401 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 17401-submit@debbugs.gnu.org id=B17401.160044496431000 (code B ref 17401); Fri, 18 Sep 2020 16:03:01 +0000 Original-Received: (at 17401) by debbugs.gnu.org; 18 Sep 2020 16:02:44 +0000 Original-Received: from localhost ([127.0.0.1]:44260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJIqS-00083v-3D for submit@debbugs.gnu.org; Fri, 18 Sep 2020 12:02:44 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:56144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJIqQ-00081a-3S for 17401@debbugs.gnu.org; Fri, 18 Sep 2020 12:02:42 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08IFwSR9027583; Fri, 18 Sep 2020 16:02:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=X3sW1JEGpxTKIVhwm+JOZtHCTkIJ9UoPtKdMlAw0fyQ=; b=paZhI/ScUFXymV7EKIZKglxTAutUt90UXngIrdwzwRkpXNvVs8/WKXltkCHDBYwlRuku V0syhC5YohCDb9MM2+pgedVKmaPcYNPaHN8bzrALnAB8kcaUNysmiJt86aE9wdlk0v42 np3s0aNVBIJwdBmBjvrmCMZFQVVWjvWmiQx9D9eemXJhF0sDosBMiIpDhKjLvrDZ///a 114NyQajw/rkdo4UBV6DJ99mp5d9jkZxZO7253ukyX2dHd9xOzFXbitSmWPo6t7J1E21 sxvklcFnloPbTnENhwK4HImJIKe8BWNVy5423ULmKXWEbpvCfd6tz2OZSIGOv6wAQeUa wg== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 33j91e1pmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Sep 2020 16:02:36 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08IFu4Nx025182; Fri, 18 Sep 2020 16:02:35 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 33hm372q6m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Sep 2020 16:02:35 +0000 Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08IG2SS9005126; Fri, 18 Sep 2020 16:02:31 GMT In-Reply-To: <87ft7fgpbm.fsf@gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5044.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9748 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180129 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9748 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 mlxlogscore=999 clxscore=1011 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180129 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188339 Archived-At: > > That post provides a function which creates a indirect clone of > > the current buffer, and narrows to the marked region in that, so > > that you have both the original un-narrowed buffer and the narrowed > > indirect clone available simultaneously. > > > > This is incredibly useful, and it seems like an obvious contender > > for standard functionality in Emacs. > > > > I'm attaching a patch which uses that approach to implement the > > following functions and bindings: > > > > C-x 4 n n: narrow-to-region-indirect-other-window > > C-x 4 n p: narrow-to-page-indirect-other-window > > C-x 4 n d: narrow-to-defun-indirect-other-window >=20 > Sounds like a good idea to me, and seems to be a logical extension. > Anybody got an opinion? >=20 > However: >=20 > > It's still essentially Zane's code, so I've confirmed that he's > > happy for me to send this, and am CCing this to him. >=20 > We'd need copyright assignment papers for something like this. Zane, > would you be willing to assign copyright for this code to the FSF? FWIW, `narrow-indirect.el' is based on this and extends it in a few ways. From the Commentary (and the wiki page): ;; Acknowledgments: ;; ;; The idea and original code for a command that combines narrowing ;; with cloning a buffer as an indirect-buffer is due to Zane Ashby: ;; https://demonastery.org/2013/04/emacs-narrow-to-region-indirect/. ;; ;; In Emacs bug thread #17401, Phil Sainty proposed adding three ;; commands to Emacs based on this approach. Lennart Borgman ;; contributed code that uses, in the cloned buffer name, some text ;; based on the narrowed region. ;; ;; The code in `narrow-indirect.el' extends this a bit and provides ;; a couple of user options and some alternative (prefix-argument) ;; behavior. It is doubtful that Emacs Dev will ever adopt features ;; such as those defined here, and if they do then this library can ;; at least help for Emacs versions prior to their addition. Description here: https://www.emacswiki.org/emacs/NarrowIndirect Code: https://www.emacswiki.org/emacs/download/narrow-indirect.el