From mboxrd@z Thu Jan 1 00:00:00 1970 From: Puneeth Chaganti Subject: Re: [PATCH] org-id-goto doesn't work if buffer is narrowed. Date: Sun, 25 Oct 2015 08:42:33 +0530 Message-ID: References: <874mhh1u7s.fsf@gmx.us> <87oafpz65e.fsf@gmx.us> <87pp04zc1r.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1130c8a076a7740522e538b2 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqBjs-0005kh-33 for emacs-orgmode@gnu.org; Sat, 24 Oct 2015 23:12:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqBjq-0006gl-Ql for emacs-orgmode@gnu.org; Sat, 24 Oct 2015 23:12:56 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:33516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqBjq-0006gD-Hr for emacs-orgmode@gnu.org; Sat, 24 Oct 2015 23:12:54 -0400 Received: by wijp11 with SMTP id p11so122878487wij.0 for ; Sat, 24 Oct 2015 20:12:53 -0700 (PDT) In-Reply-To: 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 --001a1130c8a076a7740522e538b2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Rasmus, On Sun, Oct 25, 2015 at 7:54 AM, Puneeth Chaganti wro= te: > >> However, your patch doesn=E2=80=99t work for me in the following example= , starting >> from emacs -q, adding /tmp/test.org (with the below content) to my agend= a >> list and requiring org-id, org-narrow-to-subtree on foo, and then >> org-open-at-point on the link > > I had patched `org-id-goto' and looks like clicking on links uses > `org-id-open'. I will resend a patch. I wonder if these two > functions can reuse common code. Here is a patch that works for the case you describe. The widening happens even if the target location is in a different buffer, in this patch. --001a1130c8a076a7740522e538b2 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Widen-if-target-id-location-is-not-in-the-narrow.patch" Content-Disposition: attachment; filename="0001-Widen-if-target-id-location-is-not-in-the-narrow.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ig5xvrlz0 RnJvbSBiYTYyMDQyZmYzN2MyMDBkODE0NTY3YTc5YmNiOTk5YWVmNjc1ODFjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQdW5lZXRoIENoYWdhbnRpIDxwdW5jaGFnYW5AbXVzZS1hbXVz ZS5pbj4KRGF0ZTogU3VuLCAyNSBPY3QgMjAxNSAwODoyNDowOSArMDUzMApTdWJqZWN0OiBbUEFU Q0hdIFdpZGVuIGlmIHRhcmdldCBpZCBsb2NhdGlvbiBpcyBub3QgaW4gdGhlIG5hcnJvdy4KCi0t LQogbGlzcC9vcmctaWQuZWwgfCA1MiArKysrKysrKysrKysrKysrKysrKysrKysrKy0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMjYgaW5zZXJ0aW9ucygrKSwgMjYg ZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9vcmctaWQuZWwgYi9saXNwL29yZy1pZC5l bAppbmRleCBmODZlZjIyLi41N2QyNDE0IDEwMDY0NAotLS0gYS9saXNwL29yZy1pZC5lbAorKysg Yi9saXNwL29yZy1pZC5lbApAQCAtMjkyLDEzICsyOTIsNyBAQCBJdCByZXR1cm5zIHRoZSBJRCBv ZiB0aGUgZW50cnkuICBJZiBuZWNlc3NhcnksIHRoZSBJRCBpcyBjcmVhdGVkLiIKICAgIlN3aXRj aCB0byB0aGUgYnVmZmVyIGNvbnRhaW5pbmcgdGhlIGVudHJ5IHdpdGggaWQgSUQuCiBNb3ZlIH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ZmZlcikKLQkgICAgICAgKGZpbmQtZmlsZS1vdGhlci13aW5kb3cgLiBzd2l0Y2gtdG8tYnVm ZmVyLW90aGVyLXdpbmRvdykKLQkgICAgICAgKGZpbmQtZmlsZS1vdGhlci1mcmFtZSAuIHN3aXRj aC10by1idWZmZXItb3RoZXItZnJhbWUpKSkpCi0JICAgJ3N3aXRjaC10by1idWZmZXItb3RoZXIt d2luZG93KSkKLSAgICAoaWYgKG5vdCAoZXF1YWwgKGN1cnJlbnQtYnVmZmVyKSAobWFya2VyLWJ1 ZmZlciBtKSkpCi0JKGZ1bmNhbGwgY21kIChtYXJrZXItYnVmZmVyIG0pKSkKLSAgICAoZ290by1j aGFyIG0pCi0gICAgKG1vdmUtbWFya2VyIG0gbmlsKQotICAgIChvcmctc2hvdy1jb250ZXh0KSkp CisgIChsZXQgKChjbWQgKG9yCisJICAgICAgKGNkcgorCSAgICAgICAoYXNzcQorCQkoY2RyIChh c3NxICdmaWxlIG9yZy1saW5rLWZyYW1lLXNldHVwKSkKKwkJJygoZmluZC1maWxlIC4gc3dpdGNo LXRvLWJ1ZmZlcikKKwkJICAoZmluZC1maWxlLW90aGVyLXdpbmRvdyAuIHN3aXRjaC10by1idWZm ZXItb3RoZXItd2luZG93KQorCQkgIChmaW5kLWZpbGUtb3RoZXItZnJhbWUgLiBzd2l0Y2gtdG8t YnVmZmVyLW90aGVyLWZyYW1lKSkpKQorCSAgICAgICdzd2l0Y2gtdG8tYnVmZmVyLW90aGVyLXdp bmRvdykpKQorICAgIChvcmctaWQtc2hvdyBpZCBjbWQpKSkKIAogKG9yZy1hZGQtbGluay10eXBl ICJpZCIgJ29yZy1pZC1vcGVuKQogCi0tIAoyLjUuMAoK --001a1130c8a076a7740522e538b2--