Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-26 Thread Puneeth Chaganti
On Sun, Oct 25, 2015 at 4:49 PM, Rasmus wrote: > The latest patch from > > Date: Sun, 25 Oct 2015 14:36:16 +0530 > > looks good to me. Thanks! I guess, this can be merged, then? Thanks! Puneeth

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-25 Thread Rasmus
Hi Puneeth, Puneeth Chaganti writes: >> However, you need to make sure that it only widens if ID is in the same >> buffer and outside of the narrow. In particular, when ID is in another >> file you shouldn’t widen. When it’s within the scope of the narrow it >> shouldn’t widen. This ALREADY s

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-25 Thread John Kitchin
In my solution I do store the buffer. Maybe for some reason the id is in another buffer with narrowing, and you want to preserve that narrowing when you return. I originally did that with a marker, so you could restore point to, but I decided to take that out. I wasn't aware you could have dangling

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-25 Thread Puneeth Chaganti
> If CMD raises an error, you have a dangling marker in the buffer, which > is not a great idea. I suggest to wrap everything into > a `unwind-protect' and add (set-marker m nil) as an unwindform, i.e., Fixed. Thanks! From 8ec4f777a2e1078e1fadc48a7c91366200a0d37b Mon Sep 17 00:00:00 2001 From: Pun

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-25 Thread Nicolas Goaziou
Puneeth Chaganti writes: > Thanks for your careful review and detailed comments. I've attached > an updated patch. Thank you. I have another suggestion about it. > +(defun org-id-show (id cmd) > + "Show an entry with id ID by buffer-switching using CMD. > +CMD is a function that takes a buffe

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-25 Thread Puneeth Chaganti
Hi Nicolas, On Sun, Oct 25, 2015 at 2:08 PM, Nicolas Goaziou wrote: > Hello, > > Puneeth Chaganti writes: > >> Here is a patch that works for the case you describe. > > Thank you. Some comments follow. Thanks for your careful review and detailed comments. I've attached an updated patch. -- Pu

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-25 Thread Nicolas Goaziou
Hello, Puneeth Chaganti writes: > Here is a patch that works for the case you describe. Thank you. Some comments follow. > + (org-id-show id 'org-pop-to-buffer-same-window)) (org-id-show id #'org-pop-to-buffer-same-window) > +(defun org-id-show (id cmd) > + "Show an entry with id ID by b

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Puneeth Chaganti
Hi Rasmus, On Sun, Oct 25, 2015 at 7:54 AM, Puneeth Chaganti wrote: > >> However, your patch doesn’t work for me in the following example, starting >> from emacs -q, adding /tmp/test.org (with the below content) to my agenda >> list and requiring org-id, org-narrow-to-subtree on foo, and then >>

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Puneeth Chaganti
Hi Rasmus, On Sat, Oct 24, 2015 at 5:57 PM, Rasmus wrote: > > However, you need to make sure that it only widens if ID is in the same > buffer and outside of the narrow. In particular, when ID is in another > file you shouldn’t widen. When it’s within the scope of the narrow it > shouldn’t wide

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Rasmus
John Kitchin writes: > 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-restriction-and-restoring-it-while-following-links/ > using the idea for saving and restoring the restriction. Thanks, John. You

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread John Kitchin
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-restriction-and-restoring-it-while-following-links/ using the idea for saving and restoring the restriction. John --- Profes

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Rasmus
John Kitchin writes: > Maybe I am missing something here. I would expect org-id-goto to actually > 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-restriction > type macros, so it wouldn't change your restr

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Rasmus
Hi Puneeth, First, I now think your suggestion (to widen) is consistent with the current behavior of Org. E.g. C-c C-o on a CUSTOM_IDs link will widen the buffer. Also, if ID is outside of the current file, it will follow the link. Second, I think the current behavior should be changed, but tha

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Nicolas Goaziou
Hello, John Kitchin writes: > Maybe I am missing something here. I would expect org-id-goto to actually > 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-restriction > type macros, so it wouldn't change yo

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread Puneeth Chaganti
Hi John, On Sat, Oct 24, 2015 at 5:03 PM, John Kitchin wrote: > > Maybe I am missing something here. I would expect org-id-goto to actually > 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-restriction type

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-24 Thread John Kitchin
> > > >> On Fri, Oct 23, 2015 at 8:57 PM, Rasmus wrote: > >>> It's not obvious that org should change a—potentially—carefully > selected > >>> narrowed region. > >> > >> I agree. But, am I not explicitly asking to jump to the specified > >> item. I don't mind the widening, at least when the call i

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Puneeth Chaganti
Hi Rasmus, On Sat, Oct 24, 2015 at 1:52 AM, Rasmus wrote: > Hi Puneeth, > > Thanks for the followup. > > Puneeth Chaganti writes: > >> On Fri, Oct 23, 2015 at 8:57 PM, Rasmus wrote: >>> It's not obvious that org should change a—potentially—carefully selected >>> narrowed region. >> >> I agree.

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Rasmus
Hi Puneeth, Thanks for the followup. Puneeth Chaganti writes: > On Fri, Oct 23, 2015 at 8:57 PM, Rasmus wrote: >> It's not obvious that org should change a—potentially—carefully selected >> narrowed region. > > I agree. But, am I not explicitly asking to jump to the specified > item. I don't m

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Rasmus
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 re

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Matt Lundin
Rasmus writes: > Hi Puneeth, > > Thanks for your patch. > > Puneeth Chaganti 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 c

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread John Kitchin
It has always bugged me when clicking on an id link does not put the point on the headline when narrowing is in place. Opening in a new buffer might be a nice compromise of preserving the restriction in place, and getting to the point of interest. I think these are called indirect buffers (http://

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Puneeth Chaganti
Hi Rasmus, On Fri, Oct 23, 2015 at 8:57 PM, Rasmus wrote: > It's not obvious that org should change a—potentially—carefully selected > narrowed region. I agree. But, am I not explicitly asking to jump to the specified item. I don't mind the widening, at least when the call is interactive. I agre

Re: [O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Rasmus
Hi Puneeth, Thanks for your patch. Puneeth Chaganti 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 se

[O] [PATCH] org-id-goto doesn't work if buffer is narrowed.

2015-10-23 Thread Puneeth Chaganti
Hello, 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! Thanks, Puneeth From 3f3deb84fc2e2739307e820cdfa7de1c6fbf4f23 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Fri, 23 Oct