From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH] org-id-goto doesn't work if buffer is narrowed. Date: Fri, 23 Oct 2015 22:18:57 +0200 Message-ID: <87vb9xz6by.fsf@gmx.us> References: <874mhh1u7s.fsf@gmx.us> <87611xl5kr.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpioF-0002XY-RN for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 16:19:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpioB-00082M-Sx for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 16:19:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:59386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpioB-00082E-Mf for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 16:19:27 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zpio8-0007rp-CK for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 22:19:24 +0200 Received: from 46.166.186.251 ([46.166.186.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2015 22:19:24 +0200 Received: from rasmus by 46.166.186.251 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2015 22:19:24 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Matt, Matt Lundin writes: >>> I've attached a one-line patch to fix `org-id-goto' if the target >>> buffer is narrowed. Let me know if this fix sounds reasonable or if >>> you have other suggestions! >> >> It's not obvious that org should change a—potentially—carefully selected >> narrowed region. > > Org mode already does this aggressively and often. For instance, it > irrevocably widens all buffers associated with org-agenda-files when > generating the agenda. (To replicate, try narrowing to a headline in a > buffer and then calling the agenda.) The same is true of follow mode; it > widens a buffer once one moves to a line in the agenda corresponding to > that buffer. In other words, org currently does not go out of its way to > protect user's narrowed regions. > > +1 on my part for widening a buffer if it contains a relevant id target. > If I click org-id-goto and the target is in my buffer, I want it to > widen that buffer. It’s not that Org isn’t trying to save narrows, it’s just that you found another bug (sounds like a missing org-with-wide-buffer to me, but I haven’t tried to reproduce your example). It could of course also be that the same logic is not applied in this case on purpose. In Org 8.3, you'll (thankfully) not lose your narrow when you click C-c C-c on a footnote reference outside the current narrow. Also not when you insert a new footnote. Whether it would be better to use an indirect buffer, as John suggests, or whether it would be possible to utilize the familiar interface of org-src.el for "remote editing" (or viewing) I don’t know. Rasmus -- I hear there's rumors on the, uh, Internets. . .