From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.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: Sat, 10 May 2014 21:12:44 -0700 (PDT) Message-ID: <758cb6d1-f13d-412c-8669-ae5eb23dea6b@default> References: <53661891.40206@orcon.net.nz> <536E2451.3090808@orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__1399781562616236572abhmp0019.oracle.com" X-Trace: ger.gmane.org 1399781610 30460 80.91.229.3 (11 May 2014 04:13:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2014 04:13:30 +0000 (UTC) Cc: 17401@debbugs.gnu.org, contact@zaneashby.co.nz To: Phil Sainty , Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 11 06:13:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WjL8a-00061c-RL for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 06:13:21 +0200 Original-Received: from localhost ([::1]:59701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjL8a-0002i7-2t for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 00:13:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjL8Q-0002f4-5b for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 00:13:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjL8I-0007Cd-9V for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 00:13:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjL8I-0007CQ-7N for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 00:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjL8H-0000oa-L7 for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 00:13: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: Sun, 11 May 2014 04:13: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: Original-Received: via spool by 17401-submit@debbugs.gnu.org id=B17401.13997815743113 (code B ref 17401); Sun, 11 May 2014 04:13:01 +0000 Original-Received: (at 17401) by debbugs.gnu.org; 11 May 2014 04:12:54 +0000 Original-Received: from localhost ([127.0.0.1]:58569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjL89-0000o8-Il for submit@debbugs.gnu.org; Sun, 11 May 2014 00:12:53 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:27692) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjL86-0000nr-W1 for 17401@debbugs.gnu.org; Sun, 11 May 2014 00:12:51 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4B4Ci2u025136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 11 May 2014 04:12:45 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s4B4Cgbd008733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 May 2014 04:12:44 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4B4Cgrf023390; Sun, 11 May 2014 04:12:42 GMT In-Reply-To: <536E2451.3090808@orcon.net.nz> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88881 Archived-At: --__1399781562616236572abhmp0019.oracle.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > I was initially against the idea of naming the indirect buffer > according to the narrowed region, for the simple reason that the > name stops making sense as soon as you widen the buffer. >=20 > However, I expect that people are far less likely to widen these > buffers (as opposed to simply killing them); and this naming > approach would certainly be useful in the buffer list, so I think > it's a good idea after all. >=20 > I've also noticed there are some org-mode specific narrowing > commands as well, which should probably be supported. I did > consider whether we could support all existing narrowing commands > automagically with some trickery, but I concluded that the only > approach I could think of was too convoluted and brittle for its > own good, so I think simply adding a new function alongside each > existing one is still the most practical way to go. >=20 > Do we want both a `narrow-to-*-indirect' and an `...-other-window' > variant for each case? I think the latter works very nicely with > the C-x 4 n prefix (as per the initial patch), but I can see the > utility in providing both functions. I agree about killing vs widening indirect buffers. And I don't find a need for same-window versions of the commands, for my own use. FWIW, attached is what I've been using lately. The default buffer naming is similar to what Lennart suggested, but (for the non-defun command) the region text (with whitespace collapsed) is used, not the first line. And the buffer-name length is limited. And the text following the original name is separated by ` | ' instead of being enclosed in <...>. Two options control naming: one limits the length, the other is a name prefix (e.g., to easily distinguish indirect buffers). A prefix arg prompts you for the new buffer name. For defun narrowing, a negative prefix arg prompts you for the text that follows ` | ' (in place of the defun object name). To me, being able to provide names different from the default is important. -- (FWIW, I also use library `wide-n.el', which lets you widen to any number of narrowings of the same buffer - e.g., cycle. http://www.emacswiki.org/emacs-de/MultipleNarrowings) --__1399781562616236572abhmp0019.oracle.com Content-Type: application/octet-stream; name="narrow-other.el" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="narrow-other.el" KGRlZmN1c3RvbSBuYXJyb3dlZC1idWYtbmFtZS1tYXggNjAKICAiTWF4IGxlbmd0aCBvZiBjbG9u ZWQgaW5kaXJlY3QgYnVmZmVyIG5hbWUsIGZvciBuYXJyb3dpbmcgY29tbWFuZHMuIgogIDp0eXBl ICcocmVzdHJpY3RlZC1zZXhwIDp0YWcgIk1heCBsZW5ndGggb2YgYnVmZmVyIG5hbWUiCiAgICAg ICAgICA6bWF0Y2gtYWx0ZXJuYXRpdmVzICgobGFtYmRhICh4KSAoYW5kIChpbnRlZ2VycCB4KSAg KD4geCAwKSkpKQogICAgICAgICAgOnZhbHVlIGlnbm9yZSkKICA6Z3JvdXAgJ2VkaXRpbmcpCgoo ZGVmY3VzdG9tIG5hcnJvd2VkLWJ1Zi1uYW1lLXByZWZpeCAiIgogICJOYW1lIHByZWZpeCBmb3Ig aW5kaXJlY3QgYnVmZmVyIGNsb25lZCBieSBgbmFycm93LSotaW5kaXJlY3QqJyBjb21tYW5kcy4K VXNpbmcgYSBub24tZW1wdHkgcHJlZml4IGxldHMgeW91IGVhc2lseSBkaXN0aW5ndWlzaCB0aGUg aW5kaXJlY3QKYnVmZmVycyBmcm9tIHRoZSBvcmlnaW5hbC4iCiA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CiAgICAobGV0KiAoKGJ1ZiAgKG9yIGZ1bGwtbmFtZQogICAgICAgICAgICAgICAgICAg ICB0ZXh0CiAgICAgICAgICAgICAgICAgICAgIChyZXBsYWNlLXJlZ2V4cC1pbi1zdHJpbmcKICAg ICAgICAgICAgICAgICAgICAgICJcXChccyBcXCkrIiAiXDEiCiAgICAgICAgICAgICAgICAgICAg ICAocmVwbGFjZS1yZWdleHAtaW4tc3RyaW5nCiAgICAgICAgICAgICAgICAgICAgICAgIlxcYFxz K1xcfFxzK1xcJyIgIiIKICAgICAgICAgICAgICAgICAgICAgICAoYnVmZmVyLXN1YnN0cmluZy1u by1wcm9wZXJ0aWVzIHN0YXJ0IGVuZCkpKSkpCiAgICAgICAgICAgKGJ1ZiAgKG9yIGZ1bGwtbmFt ZQogICAgICAgICAgICAgICAgICAgICAoY29uY2F0IG5hcnJvd2VkLWJ1Zi1uYW1lLXByZWZpeCAo YnVmZmVyLW5hbWUpICIgfCAiIGJ1ZikpKQogICAgICAgICAgIChidWYgIChvciBmdWxsLW5hbWUK ICAgICAgICAgICAgICAgICAgICAgKHN1YnN0cmluZyBidWYgMCAobWluIChsZW5ndGggYnVmKSBu YXJyb3dlZC1idWYtbmFtZS1tYXgpKSkpCiAgICAgICAgICAgKGJ1ZiAgKGNsb25lLWluZGlyZWN0 LWJ1ZmZlciBidWYgbmlsKSkpCiAgICAgICh3aXRoLWN1cnJlbnQtYnVmZmVyIGJ1ZiAobmFycm93 LXRvLXJlZ2lvbiBzdGFydCBlbmQpIChnb3RvLWNoYXIgaGVyZSkpCiAgICAgIChwb3AtdG8tYnVm ZmVyIGJ1ZikpKSkKCihkZWZpbmUta2V5IGN0bC14LTQtbWFwICJubiIgJ25hcnJvdy10by1yZWdp b24taW5kaXJlY3Qtb3RoZXItd2luZG93KQooZGVmaW5lLWtleSBjdGwteC00LW1hcCAibmQiICdu YXJyb3ctdG8tZGVmdW4taW5kaXJlY3Qtb3RoZXItd2luZG93KQoK --__1399781562616236572abhmp0019.oracle.com--