From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: [PATCH] org-id-goto doesn't work if buffer is narrowed. Date: Sat, 24 Oct 2015 13:48:26 -0400 Message-ID: References: <874mhh1u7s.fsf@gmx.us> <87oafpz65e.fsf@gmx.us> <87d1w4zb5b.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013d0f9ad696a20522dd557c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq2vd-0006Qe-H9 for emacs-orgmode@gnu.org; Sat, 24 Oct 2015 13:48:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zq2vb-0004rQ-UR for emacs-orgmode@gnu.org; Sat, 24 Oct 2015 13:48:29 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:38809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq2vb-0004qu-LX for emacs-orgmode@gnu.org; Sat, 24 Oct 2015 13:48:27 -0400 Received: by wicll6 with SMTP id ll6so66969031wic.1 for ; Sat, 24 Oct 2015 10:48:26 -0700 (PDT) In-Reply-To: <87d1w4zb5b.fsf@gmx.us> 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: Rasmus Cc: "emacs-orgmode@gnu.org" --089e013d0f9ad696a20522dd557c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I like the idea too. I worked out a partial solution for id links here: http://kitchingroup.cheme.cmu.edu/blog/2015/10/24/Saving-the-current-restri= ction-and-restoring-it-while-following-links/ using the idea for saving and restoring the restriction. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sat, Oct 24, 2015 at 8:47 AM, Rasmus wrote: > John Kitchin writes: > > > Maybe I am missing something here. I would expect org-id-goto to actual= ly > > get to the id entry when it is used independent of narrowing. When used > in > > a program, I would expect this behavior to be wrapped in save-restricti= on > > type macros, so it wouldn't change your restriction. But when used > > interactively, e.g. when I click on a link, I expect the point to end u= p > on > > the id entry, with the buffer open in front of me, even if that means > > widening. Is there some other expectation that makes sense? I feel like > it > > is up to me to decide if breaking the restriction is worth visiting the > > link, and only by clicking on the link or running an interactive comman= d > > makes that happen. > > I prefer the behavior of C-c C-c on a footnote in a narrowed buffer. > I.e. throw an error. > > > > Is it possible to save a restriction in a variable? so that something > like > > C-c & could restore it? the save-restriction macro must do something > like > > that, but the code seems to be hidden in the C-source for me. > > > I thought about that. I sort of like, but I also think it=E2=80=99s a po= tentially > big change... > > A poor man=E2=80=99s solution might be: > > (when (buffer-narrowed-p) (cons (point-min) (point-max))) > > Rasmus > > -- > When the facts change, I change my mind. What do you do, sir? > > > --089e013d0f9ad696a20522dd557c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I like the idea too. I worked out a partial solution for i= d links here:=C2=A0http://kitchingroup.cheme.cmu.edu/blog/2015/10/24/Saving-the-current-rest= riction-and-restoring-it-while-following-links/ using the idea for savi= ng and restoring the restriction.

John

-----------------------------------
Professor John = Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical EngineeringCarnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
<= div dir=3D"ltr">@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Sat, Oct 24, 2015 at 8:47 AM, Rasmus <rasmus= @gmx.us> wrote:
John Kitchin <jkitchin@= andrew.cmu.edu> writes:

> Maybe I am missing something here. I would expect org-id-goto to actua= lly
> get to the id entry when it is used independent of narrowing. When use= d in
> a program, I would expect this behavior to be wrapped in save-restrict= ion
> type macros, so it wouldn't change your restriction. But when used=
> interactively, e.g. when I click on a link, I expect the point to end = up on
> the id entry, with the buffer open in front of me, even if that means<= br> > widening. Is there some other expectation that makes sense? I feel lik= e it
> is up to me to decide if breaking the restriction is worth visiting th= e
> link, and only by clicking on the link or running an interactive comma= nd
> makes that happen.

I prefer the behavior of C-c C-c on a footnote in a narrowed buffer.=
I.e. throw an error.


> Is it possible to save a restriction in a variable? so that something = like
> C-c & could restore it?=C2=A0 the save-restriction macro must do s= omething like
> that, but the code seems to be hidden in the C-source for me.


I thought about that.=C2=A0 I sort of like, but I also think it=E2= =80=99s a potentially
big change...

A poor man=E2=80=99s solution might be:

=C2=A0 (when (buffer-narrowed-p) (cons (point-min) (point-max)))

Rasmus

--
When the facts change, I change my mind. What do you do, sir?



--089e013d0f9ad696a20522dd557c--