emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-store-link forgets external filename?
@ 2009-07-05 13:09 Stefan Vollmar
  2009-07-05 21:27 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Vollmar @ 2009-07-05 13:09 UTC (permalink / raw)
  To: Org Mode

Hello,

I just noticed that there seems to be a problem with org-store-link  
(or in that context) with the current development version (6.28trans).

I want to insert a link to one section of one org-file into another  
org-file, so I change to the file with the section I want to link to  
and use org-store-link (that section already has an ID property; the  
heading's name is displayed in the minibuffer - fine). I return to the  
file where I want to insert the link and use org-insert-link which  
offers the id I had just stored.

(1) However, only the id is inserted and org seems to forget about the  
other file's name, "literal hyperlinks" yields:
[[id:2806BA39-087E-4E2E-89E6-6DFA332727D2][some heading]]
When exporting to HTML, the link is rendered to a local link (here:  
"#2806BA39...") of the current file rather than "./my-other-org- 
file#2806BA39...", which is a problem, of course. Clicking on the link  
in org-mode will also not open the file.

(2) org-insert-link offers a list of ids which have been stored with  
the corresponding headings added on the right, using Arrow-Up and  
Arrow-Down will show the selected id in the minibuffer. As I want org  
to come up with unique ids for sections automatically (it does), I am  
usually not interested what ids it actually generates and I would  
suggest a different approach with org-insert-link: have a list of  
headings instead of a list of ids and show the selected link's  
heading, not its id, in the minibuffer, sorry if this has been  
discussed before. There may be cases where it is important to see a  
link's id in the selection so one could have an optional mode that  
adds the ids to the list.

Warm regards,
  Stefan
-- 
Dr. Stefan Vollmar, Dipl.-Phys.
Max-Planck-Institut für neurologische Forschung
Gleuelerstr. 50, 50931 Köln, Germany
Tel.: +49-221-4726-213  FAX +49-221-4726-298
Tel.: +49-221-478-5713  Mobile: 0160-93874279
Email: vollmar@nf.mpg.de   http://www.nf.mpg.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org-store-link forgets external filename?
  2009-07-05 13:09 org-store-link forgets external filename? Stefan Vollmar
@ 2009-07-05 21:27 ` Carsten Dominik
       [not found]   ` <47E3A1B3-8065-4739-90B9-600664BB6E56@nf.mpg.de>
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2009-07-05 21:27 UTC (permalink / raw)
  To: Stefan Vollmar; +Cc: Org Mode

Hi Stefan,

the magic of id: links is just that they are globally unique, and that
they will find the right target even if you move the target entry
from one file to another.  Therefore, export to HTML should  
automatically insert the correct file name.  And this is just how it  
works for me.

File a has

* headline 1
   :PROPERTIES:
   :ID:       5E58A8EE-0DFC-4D05-BA53-D6B969919049
   :END:

In file b I am inserting

here is the [[id:5E58A8EE-0DFC-4D05-BA53-D6B969919049][headline 1]]

and in HTML this becomes a link

<a href="a.html#ID-5E58A8EE-0DFC-4D05-BA53-D6B969919049">headline 1</a>

Try M-x org-id-update-id-location to fix ID confusion.

HTH

- Carsten



On Jul 5, 2009, at 3:09 PM, Stefan Vollmar wrote:

> Hello,
>
> I just noticed that there seems to be a problem with org-store-link  
> (or in that context) with the current development version (6.28trans).
>
> I want to insert a link to one section of one org-file into another  
> org-file, so I change to the file with the section I want to link to  
> and use org-store-link (that section already has an ID property; the  
> heading's name is displayed in the minibuffer - fine). I return to  
> the file where I want to insert the link and use org-insert-link  
> which offers the id I had just stored.
>
> (1) However, only the id is inserted and org seems to forget about  
> the other file's name, "literal hyperlinks" yields:
> [[id:2806BA39-087E-4E2E-89E6-6DFA332727D2][some heading]]
> When exporting to HTML, the link is rendered to a local link (here:  
> "#2806BA39...") of the current file rather than "./my-other-org- 
> file#2806BA39...", which is a problem, of course. Clicking on the  
> link in org-mode will also not open the file.
>
> (2) org-insert-link offers a list of ids which have been stored with  
> the corresponding headings added on the right, using Arrow-Up and  
> Arrow-Down will show the selected id in the minibuffer. As I want  
> org to come up with unique ids for sections automatically (it does),  
> I am usually not interested what ids it actually generates and I  
> would suggest a different approach with org-insert-link: have a list  
> of headings instead of a list of ids and show the selected link's  
> heading, not its id, in the minibuffer, sorry if this has been  
> discussed before. There may be cases where it is important to see a  
> link's id in the selection so one could have an optional mode that  
> adds the ids to the list.
>
> Warm regards,
> Stefan
> -- 
> Dr. Stefan Vollmar, Dipl.-Phys.
> Max-Planck-Institut für neurologische Forschung
> Gleuelerstr. 50, 50931 Köln, Germany
> Tel.: +49-221-4726-213  FAX +49-221-4726-298
> Tel.: +49-221-478-5713  Mobile: 0160-93874279
> Email: vollmar@nf.mpg.de   http://www.nf.mpg.de
>
>
>
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org-store-link forgets external filename?
       [not found]   ` <47E3A1B3-8065-4739-90B9-600664BB6E56@nf.mpg.de>
@ 2009-07-06 14:04     ` Carsten Dominik
  0 siblings, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2009-07-06 14:04 UTC (permalink / raw)
  To: Stefan Vollmar; +Cc: org-mode mailing list


On Jul 6, 2009, at 12:18 AM, Stefan Vollmar wrote:

> Dear Carsten,
>
> On 05.07.2009, at 23:27, Carsten Dominik wrote:
>
>> Hi Stefan,
>>
>> the magic of id: links is just that they are globally unique, and  
>> that
>> they will find the right target even if you move the target entry
>> from one file to another.  Therefore, export to HTML should  
>> automatically insert the correct file name.  And this is just how  
>> it works for me.
>
> thanks for the quick and detailed reply!
>
> [...]
>> Try M-x org-id-update-id-location to fix ID confusion.
>
> indeed everything now works just fine after calling org-id-update-id- 
> location in all files. However, the question remains: what went  
> wrong and is this a rare problem? Maybe some copy-paste-artefact?

This is clearly a possibility.

>
> One other thing: I mentioned on the list a short while ago that we  
> need a list of headings with their corresponding links in the HTML  
> export to generate online help in QtAssistant format. I might even  
> get one of my students to look into it - I assume one could hook  
> into some HTML export functions. Could you give us a hint on where  
> to look?

   (org-map-entries
    '(list level
           (org-no-properties (org-get-heading 'notags))
           (or (org-entry-get nil "CUSTOM_ID")
               (org-entry-get nil "ID")))
    "LEVEL<=3" 'file)

will return a list of elements, each with level (1-3), heading, and
custom or U identifier that can be used in a link.

I that what you are looking for?

- Carsten

P.S.  Yes, the mapping API is *very* powerful, a pity that
not more people use it.

>
> Many thanks in advance.
> Warm regards,
> Stefan
>
>
>>
>> HTH
>>
>> - Carsten
>>
>>
>>
>> On Jul 5, 2009, at 3:09 PM, Stefan Vollmar wrote:
>>
>>> Hello,
>>>
>>> I just noticed that there seems to be a problem with org-store- 
>>> link (or in that context) with the current development version  
>>> (6.28trans).
>>>
>>> I want to insert a link to one section of one org-file into  
>>> another org-file, so I change to the file with the section I want  
>>> to link to and use org-store-link (that section already has an ID  
>>> property; the heading's name is displayed in the minibuffer -  
>>> fine). I return to the file where I want to insert the link and  
>>> use org-insert-link which offers the id I had just stored.
>>>
>>> (1) However, only the id is inserted and org seems to forget about  
>>> the other file's name, "literal hyperlinks" yields:
>>> [[id:2806BA39-087E-4E2E-89E6-6DFA332727D2][some heading]]
>>> When exporting to HTML, the link is rendered to a local link  
>>> (here: "#2806BA39...") of the current file rather than "./my-other- 
>>> org-file#2806BA39...", which is a problem, of course. Clicking on  
>>> the link in org-mode will also not open the file.
>>>
>>> (2) org-insert-link offers a list of ids which have been stored  
>>> with the corresponding headings added on the right, using Arrow-Up  
>>> and Arrow-Down will show the selected id in the minibuffer. As I  
>>> want org to come up with unique ids for sections automatically (it  
>>> does), I am usually not interested what ids it actually generates  
>>> and I would suggest a different approach with org-insert-link:  
>>> have a list of headings instead of a list of ids and show the  
>>> selected link's heading, not its id, in the minibuffer, sorry if  
>>> this has been discussed before. There may be cases where it is  
>>> important to see a link's id in the selection so one could have an  
>>> optional mode that adds the ids to the list.
>>>
>>> Warm regards,
>>> Stefan
>>> -- 
>>> Dr. Stefan Vollmar, Dipl.-Phys.
>>> Max-Planck-Institut für neurologische Forschung
>>> Gleuelerstr. 50, 50931 Köln, Germany
>>> Tel.: +49-221-4726-213  FAX +49-221-4726-298
>>> Tel.: +49-221-478-5713  Mobile: 0160-93874279
>>> Email: vollmar@nf.mpg.de   http://www.nf.mpg.de
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Remember: use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
> -- 
> Dr. Stefan Vollmar, Dipl.-Phys.
> Max-Planck-Institut für neurologische Forschung
> Gleuelerstr. 50, 50931 Köln, Germany
> Tel.: +49-221-4726-213  FAX +49-221-4726-298
> Tel.: +49-221-478-5713  Mobile: 0160-93874279
> Email: vollmar@nf.mpg.de   http://www.nf.mpg.de
>
>
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-06 14:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-05 13:09 org-store-link forgets external filename? Stefan Vollmar
2009-07-05 21:27 ` Carsten Dominik
     [not found]   ` <47E3A1B3-8065-4739-90B9-600664BB6E56@nf.mpg.de>
2009-07-06 14:04     ` Carsten Dominik

Code repositories for project(s) associated with this 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).