From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Help resolving CUSTOM_ID based links that point to outside current subtree scope Date: Fri, 28 Jul 2017 19:19:03 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1141081c7a26250555658ec4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbAn6-0004RZ-SU for emacs-orgmode@gnu.org; Fri, 28 Jul 2017 15:19:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbAn5-0005Xl-PW for emacs-orgmode@gnu.org; Fri, 28 Jul 2017 15:19:16 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:37668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dbAn5-0005XE-Dk for emacs-orgmode@gnu.org; Fri, 28 Jul 2017 15:19:15 -0400 Received: by mail-lf0-x22c.google.com with SMTP id m86so87859564lfi.4 for ; Fri, 28 Jul 2017 12:19:15 -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" To: emacs-org list --001a1141081c7a26250555658ec4 Content-Type: text/plain; charset="UTF-8" Ah! I made a typo in the example above; here's the corrected one: * Link source :PROPERTIES: :EXPORT_FILE_NAME: link-source :END: - Link to [[#link-dest][Link dest]] * Link dest :PROPERTIES: :EXPORT_FILE_NAME: link-dest :CUSTOM_ID: link-dest :END: ("Link source" and "Link dest" subtrees are at the same level. So exporting just "Link source" subtree does not 'see' the "Link dest" subtree.) On Fri, Jul 28, 2017 at 3:17 PM Kaushal Modi wrote: > Hello, > > Is there a way to make org-export-resolve-id-link look for link resolution > outside the current scope? > > I just threw in a (save-restriction (widen) ..) inside > org-export-resolve-id-link, and that of course did not work (and thus this > email). > > Below is a little example: > > * Link source > :PROPERTIES: > :EXPORT_FILE_NAME: link-source > :END: > - Link to [[#link-dest][Link dest]] > ** Link dest > :PROPERTIES: > :EXPORT_FILE_NAME: link-dest > :CUSTOM_ID: link-dest > :END: > > - I would like to export just the "Link source" subtree (let's say C-c C-e > C-s t A), and have the link resolve to the "link-dest" CUSTOM_ID. > - To put this the other way, I want to export just the subtree, but look > at the whole buffer for link resolution. > > I know that does not make sense, but I need that for the Hugo exporter > backend. > > Application: I have one subtree (Hugo post) containing a CUSTOM_ID based > internal link to some other subtree (Hugo post), and I want to retain the > link reference. Hugo would then figure out the rest. > > What function could I advice and with what to make this happen? > > Thanks. > -- > > Kaushal Modi > -- Kaushal Modi --001a1141081c7a26250555658ec4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah! I made a typo in the example above; here's the cor= rected one:

* Link so= urce
:PROPERTIES:
:EXPORT_FILE_NAME: link-source
:END:
= - Link to [[#link-dest][Link dest]]
* Link dest
:PROPERTIES:
:EXPORT_FILE_NAME: link-dest
:CUSTOM_ID: link-dest
:END:

("Link source" and "Li= nk dest" subtrees are at the same level. So exporting just "Link = source" subtree does not 'see' the "Link dest" subtr= ee.)

On Fri, Jul= 28, 2017 at 3:17 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:
Hello,

Is there a wa= y to make org-export-resolve-id-link look for link resolution outside the c= urrent scope?

I just threw in a (save-restriction = (widen) ..) inside org-export-resolve-id-link, and that of course did not w= ork (and thus this email).

Below is a little examp= le:

* Link source
:PROPERTIES:
=
:EXPORT_FILE_NAME: link-source
:END:
- Link to= [[#link-dest][Link dest]]
** Link dest
:PROPERTIES:
:EXPORT_FILE_NAME: link-dest
:CUSTOM_ID: link-dest
:END:

- I would like to export just the &q= uot;Link source" subtree (let's say C-c C-e C-s t A), and have the= link resolve to the "link-dest" CUSTOM_ID.=C2=A0
- To = put this the other way, I want to export just the subtree, but look at the = whole buffer for link resolution.

I know that does= not make sense, but I need that for the Hugo exporter backend.=C2=A0
=

Application: I have one subtree (Hugo post) containing = a CUSTOM_ID based internal link to some other subtree (Hugo post), and I wa= nt to retain the link reference. Hugo would then figure out the rest.
=

What function could I advice and with what to make this= happen?

Thanks.
--

Kaushal Modi

--

Kaushal Modi

--001a1141081c7a26250555658ec4--