emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: punchagan@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-id-goto doesn't work if buffer is narrowed.
Date: Sat, 24 Oct 2015 14:27:44 +0200	[thread overview]
Message-ID: <87pp04zc1r.fsf@gmx.us> (raw)
In-Reply-To: <CALnw1fRk0a0SpfDASVz8G66iHH4sHGm24WnhkoW69ycBjrVnpQ@mail.gmail.com> (Puneeth Chaganti's message of "Sat, 24 Oct 2015 10:59:31 +0530")

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 that is
a separate discussion.

Thus, I think for now your suggestion is the correct one.

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 seems to be the case.

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
org-open-at-point on the link

    * foo
    [[id:myid]]  now C-c C-o on link

    * bar
    :PROPERTIES:
    :ID:       myid
    :END:

We can add your patch when it works properly.

> I find it weird to have a subtly different thing happening depending
> on whether or not the target buffer is narrowed -- entry shown in
> normal buffer when no narrowing vs. entry shown in a special/indirect
> buffer.

Widening is the current behavior when you click on a most link in a
narrowed buffer.  Personally, I would rather throw an error.

> Also, given that no other part of org really uses indirect buffers, I
> don't know if this function alone should make use of that feature.

Another option might be to make "C-c &" recall the last narrow (as John
also mentions).  But this is sort of redefining the meaning of C-c &,
which may not be comfortable.

> PS: I've patched my org sources to do indirect buffers for this, and
> will try it out for sometime to see how it feels.

Thanks a lot for your efforts, Puneeth.

Cheers,
Rasmus

-- 
Together we will make the possible totalllly impossible!

  parent reply	other threads:[~2015-10-24 12:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 15:11 [PATCH] org-id-goto doesn't work if buffer is narrowed Puneeth Chaganti
2015-10-23 15:27 ` Rasmus
2015-10-23 18:05   ` Puneeth Chaganti
2015-10-23 18:48     ` John Kitchin
2015-10-23 20:22     ` Rasmus
2015-10-24  5:29       ` Puneeth Chaganti
2015-10-24 11:33         ` John Kitchin
2015-10-24 11:49           ` Puneeth Chaganti
2015-10-24 11:57           ` Nicolas Goaziou
2015-10-24 12:47           ` Rasmus
2015-10-24 17:48             ` John Kitchin
2015-10-24 18:03               ` Rasmus
2015-10-25 11:11                 ` John Kitchin
2015-10-24 12:27         ` Rasmus [this message]
2015-10-25  2:24           ` Puneeth Chaganti
2015-10-25  3:12             ` Puneeth Chaganti
2015-10-25  8:38               ` Nicolas Goaziou
2015-10-25  9:10                 ` Puneeth Chaganti
2015-10-25  9:42                   ` Nicolas Goaziou
2015-10-25  9:57                     ` Puneeth Chaganti
2015-10-25 11:19             ` Rasmus
2015-10-26 14:14               ` Puneeth Chaganti
2015-10-23 19:59   ` Matt Lundin
2015-10-23 20:18     ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp04zc1r.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=punchagan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).