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 14:40:23 +0530 Message-ID: References: <874mhh1u7s.fsf@gmx.us> <87oafpz65e.fsf@gmx.us> <87pp04zc1r.fsf@gmx.us> <87k2qbbaw3.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7b6049c02af5e00522ea381f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqHK9-0003W2-TC for emacs-orgmode@gnu.org; Sun, 25 Oct 2015 05:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqHK8-00052U-MQ for emacs-orgmode@gnu.org; Sun, 25 Oct 2015 05:10:45 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:38379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqHK8-00052M-CU for emacs-orgmode@gnu.org; Sun, 25 Oct 2015 05:10:44 -0400 Received: by wicll6 with SMTP id ll6so78341631wic.1 for ; Sun, 25 Oct 2015 02:10:43 -0700 (PDT) In-Reply-To: <87k2qbbaw3.fsf@nicolasgoaziou.fr> 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: Puneeth Chaganti , Rasmus , emacs-orgmode --047d7b6049c02af5e00522ea381f Content-Type: text/plain; charset=UTF-8 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. -- Puneeth --047d7b6049c02af5e00522ea381f 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_ig6aojhk0 RnJvbSA1ZjA3NDY1NjZjYzYzYzM3NjM0YjIwMDcwYTUwNjAxYzViYjk5MGFiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQdW5lZXRoIENoYWdhbnRpIDxwdW5jaGFnYW5AbXVzZS1hbXVz ZS5pbj4KRGF0ZTogU3VuLCAyNSBPY3QgMjAxNSAxNDozNjoxNiArMDUzMApTdWJqZWN0OiBbUEFU Q0hdIFdpZGVuIGlmIHRhcmdldCBpZCBsb2NhdGlvbiBpcyBub3QgaW4gdGhlIG5hcnJvdy4KCklm IHRoZSB0YXJnZXQgbG9jYXRpb24gZm9yIGBvcmctaWQtZ290bycgb3IgYG9yZy1pZC1vcGVuJyBp cyBpbiBhCm5hcnJvd2VkIGJ1ZmZlciBidXQgbm90IGluIHRoZSBuYXJyb3dlZCByZWdpb24sIHRo ZSBidWZmZXIgaXMgd2lkZW5lZC4KLS0tCiBsaXNwL29yZy1pZC5lbCB8IDU0ICsrKysrKysrKysr KysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5n ZWQsIDI4IGluc2VydGlvbnMoKyksIDI2IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3Av b3JnLWlkLmVsIGIvbGlzcC9vcmctaWQuZWwKaW5kZXggZjg2ZWYyMi4uMGU4YmE3NSAxMDA2NDQK LS0tIGEvbGlzcC9vcmctaWQuZWwKKysrIGIvbGlzcC9vcmctaWQuZWwKQEAgLTI5MiwxMyArMjky LDcgQEAgSXQgcmV0dXJucyB0aGUgSUQgb2YgdGhlIGVudHJ5LiAgSWYgbmVjZXNzYXJ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YW1lKSkpKQorCSAgICAgICMnc3dpdGNoLXRvLWJ1ZmZlci1vdGhlci13aW5kb3cpKSkKKyAg ICAob3JnLWlkLXNob3cgaWQgY21kKSkpCiAKIChvcmctYWRkLWxpbmstdHlwZSAiaWQiICdvcmct aWQtb3BlbikKIAotLSAKMi41LjAKCg== --047d7b6049c02af5e00522ea381f--