emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Link to heading in another org file
@ 2009-01-14  8:59 Daniel Clemente
  2009-01-14 10:04 ` Tassilo Horn
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Clemente @ 2009-01-14  8:59 UTC (permalink / raw)
  To: emacs org-mode mailing list


Hi,
  I'm trying to link to a heading in another org file. I assume it's possible and I remember a related discussion (maybe about those links in HTML), but I didn't find it.
  I tried to use intuitively this syntax (it doesn't work):

[[file:proj.org#*some heading]]

  This is similar to [[gnus:group#id]]. This syntax would disallow using # in a file name, but I think this is reasonable to do. It can be escaped with [#] like spaces.

  Whether org uses this syntax or another, no example of this appears at http://orgmode.org/manual/External-links.html#External-links . It could be added there.


Thanks,

Daniel

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

* Re: Link to heading in another org file
  2009-01-14  8:59 Link to heading in another org file Daniel Clemente
@ 2009-01-14 10:04 ` Tassilo Horn
  2009-01-14 10:38   ` Daniel Clemente
  0 siblings, 1 reply; 11+ messages in thread
From: Tassilo Horn @ 2009-01-14 10:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi Daniel,

If I call `org-store-link' on a headline it creates a link like

   file:~/iese.org::*Merge%20invoke%20insert%20invokation%20statement

which I can insert in any other org file using `org-insert-link'.  Works
fine for me.

Bye,
Tassilo
-- 
Richard Stallman gets 9 bits to the byte.

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

* Re: Re: Link to heading in another org file
  2009-01-14 10:04 ` Tassilo Horn
@ 2009-01-14 10:38   ` Daniel Clemente
  2009-01-14 12:17     ` Tassilo Horn
  2009-01-19 15:36     ` Daniel Clemente
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Clemente @ 2009-01-14 10:38 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode


Ok, so it was [[file:proj.org::*some heading]] instead of [[file:proj.org#*some heading]], fine.

  Could it be documented as example in http://orgmode.org/manual/External-links.html#External-links
  This also refers to it: http://orgmode.org/manual/Publishing-links.html#Publishing-links


Daniel

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

* Re: Link to heading in another org file
  2009-01-14 10:38   ` Daniel Clemente
@ 2009-01-14 12:17     ` Tassilo Horn
  2009-01-17 12:39       ` Carsten Dominik
  2009-01-19 15:36     ` Daniel Clemente
  1 sibling, 1 reply; 11+ messages in thread
From: Tassilo Horn @ 2009-01-14 12:17 UTC (permalink / raw)
  To: emacs-orgmode

Daniel Clemente <n142857@gmail.com> writes:

> Ok, so it was [[file:proj.org::*some heading]] instead of
> [[file:proj.org#*some heading]], fine.

I've just noticed that if you have two headlines with the same text,
it'll always link to the first one.

>   Could it be documented as example in
>   http://orgmode.org/manual/External-links.html#External-links This
>   also refers to it:
>   http://orgmode.org/manual/Publishing-links.html#Publishing-links

Yes, that should be done.  But users normally shouldn't write links
manually and simply use `org-store-link' which DTRT.

Bye,
Tassilo

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

* Re: Re: Link to heading in another org file
  2009-01-14 12:17     ` Tassilo Horn
@ 2009-01-17 12:39       ` Carsten Dominik
  2009-01-17 17:18         ` Tassilo Horn
  0 siblings, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2009-01-17 12:39 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode


On Jan 14, 2009, at 1:17 PM, Tassilo Horn wrote:

> Daniel Clemente <n142857@gmail.com> writes:
>
>> Ok, so it was [[file:proj.org::*some heading]] instead of
>> [[file:proj.org#*some heading]], fine.
>
> I've just noticed that if you have two headlines with the same text,
> it'll always link to the first one.

Yes.  Using ID links will work around this.

- Carsten

>
>
>>  Could it be documented as example in
>>  http://orgmode.org/manual/External-links.html#External-links This
>>  also refers to it:
>>  http://orgmode.org/manual/Publishing-links.html#Publishing-links
>
> Yes, that should be done.  But users normally shouldn't write links
> manually and simply use `org-store-link' which DTRT.
>
> Bye,
> Tassilo
>
>
>
> _______________________________________________
> 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] 11+ messages in thread

* Re: Link to heading in another org file
  2009-01-17 12:39       ` Carsten Dominik
@ 2009-01-17 17:18         ` Tassilo Horn
  2009-01-18  7:30           ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Tassilo Horn @ 2009-01-17 17:18 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:

Hi Carsten,

>>> Ok, so it was [[file:proj.org::*some heading]] instead of
>>> [[file:proj.org#*some heading]], fine.
>>
>> I've just noticed that if you have two headlines with the same text,
>> it'll always link to the first one.
>
> Yes.  Using ID links will work around this.

Hey, that's great, I wasn't aware of that feature.  And afterwards I
also found it in the docs. ;-)

BTW, the docs state:

,----[ (info "(org)Handling links") ]
| `C-c l'
|      Store a link to the current location.  This is a _global_ command
|      which can be used in any buffer to create a link.
`----

Here, `C-c l' is neither bound in org files nor globally.  I grepped my
config files but I don't set/release that key somewhere.  (And if it was
bound I would complain that org shouldn't dictate global keys,
anyway. ;-))

Bye,
Tassilo

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

* Re: Re: Link to heading in another org file
  2009-01-17 17:18         ` Tassilo Horn
@ 2009-01-18  7:30           ` Carsten Dominik
  2009-01-18  9:26             ` Tassilo Horn
  0 siblings, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2009-01-18  7:30 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode


On Jan 17, 2009, at 6:18 PM, Tassilo Horn wrote:

> Carsten Dominik <dominik@science.uva.nl> writes:
>
> Hi Carsten,
>
>>>> Ok, so it was [[file:proj.org::*some heading]] instead of
>>>> [[file:proj.org#*some heading]], fine.
>>>
>>> I've just noticed that if you have two headlines with the same text,
>>> it'll always link to the first one.
>>
>> Yes.  Using ID links will work around this.
>
> Hey, that's great, I wasn't aware of that feature.  And afterwards I
> also found it in the docs. ;-)
>
> BTW, the docs state:
>
> ,----[ (info "(org)Handling links") ]
> | `C-c l'
> |      Store a link to the current location.  This is a _global_  
> command
> |      which can be used in any buffer to create a link.
> `----
>
> Here, `C-c l' is neither bound in org files nor globally.  I grepped  
> my
> config files but I don't set/release that key somewhere.  (And if it  
> was
> bound I would complain that org shouldn't dictate global keys,
> anyway. ;-))

Under "Activation", the manual also states:

,-----
| Add the following lines to your `.emacs' file.  The last three lines
| define _global_ keys for the commands `org-store-link', `org-agenda',
| and `org-iswitchb' - please choose suitable keys yourself.
|
|     ;; The following lines are always needed.  Choose your own keys.
|     (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
|     (global-set-key "\C-cl" 'org-store-link)
|     (global-set-key "\C-ca" 'org-agenda)
|     (global-set-key "\C-cb" 'org-iswitchb)
`-----

I do not want to re-iterate this information each time I talk about
one of the global commands.


- Carsten

>
>
> Bye,
> Tassilo
>
>
>
> _______________________________________________
> 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] 11+ messages in thread

* Re: Re: Link to heading in another org file
  2009-01-18  7:30           ` Carsten Dominik
@ 2009-01-18  9:26             ` Tassilo Horn
  2009-01-18 17:47               ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Tassilo Horn @ 2009-01-18  9:26 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:

Hi Carsten,

> Under "Activation", the manual also states:
>
> ,-----
> | Add the following lines to your `.emacs' file.  The last three lines
> | define _global_ keys for the commands `org-store-link', `org-agenda',
> | and `org-iswitchb' - please choose suitable keys yourself.
> |
> |     ;; The following lines are always needed.  Choose your own keys.
> |     (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
> |     (global-set-key "\C-cl" 'org-store-link)
> |     (global-set-key "\C-ca" 'org-agenda)
> |     (global-set-key "\C-cb" 'org-iswitchb)
> `-----
>
> I do not want to re-iterate this information each time I talk about
> one of the global commands.

I see.  But wouldn't it then be better to talk about the functions then,
not about global keys the manual suggests?

Bye,
Tassilo
-- 
TNT was originally developed by Chuck Norris to cure indigestion. 

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

* Re: Re: Link to heading in another org file
  2009-01-18  9:26             ` Tassilo Horn
@ 2009-01-18 17:47               ` Carsten Dominik
  0 siblings, 0 replies; 11+ messages in thread
From: Carsten Dominik @ 2009-01-18 17:47 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode


On Jan 18, 2009, at 10:26 AM, Tassilo Horn wrote:

> Carsten Dominik <dominik@science.uva.nl> writes:
>
> Hi Carsten,
>
>> Under "Activation", the manual also states:
>>
>> ,-----
>> | Add the following lines to your `.emacs' file.  The last three  
>> lines
>> | define _global_ keys for the commands `org-store-link', `org- 
>> agenda',
>> | and `org-iswitchb' - please choose suitable keys yourself.
>> |
>> |     ;; The following lines are always needed.  Choose your own  
>> keys.
>> |     (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
>> |     (global-set-key "\C-cl" 'org-store-link)
>> |     (global-set-key "\C-ca" 'org-agenda)
>> |     (global-set-key "\C-cb" 'org-iswitchb)
>> `-----
>>
>> I do not want to re-iterate this information each time I talk about
>> one of the global commands.
>
> I see.  But wouldn't it then be better to talk about the functions  
> then,
> not about global keys the manual suggests?

Maybe it would, but the entire Org-mode documentation is based
on keys rather than function names.  I find that the long function
names make Emacs documentation in written form less readable
for users who do not want to deal with Lisp themselves.  Org's manual
is similar in this to the Emacs manual, and if you compare this
way o writing for example with the planner manual, it does read
a lot better for my taste.

So, OK, I will make another remark that this key binding is user
chosen, but I will keep it in the manual like this.

- Carsten

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

* Re: Re: Link to heading in another org file
  2009-01-14 10:38   ` Daniel Clemente
  2009-01-14 12:17     ` Tassilo Horn
@ 2009-01-19 15:36     ` Daniel Clemente
  2009-01-20  5:18       ` Carsten Dominik
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Clemente @ 2009-01-19 15:36 UTC (permalink / raw)
  To: emacs-orgmode


Could this [[file proj.org::*some heading]] syntax be documented? I attach a simple patch:

--- a/doc/org.texi
+++ b/doc/org.texi
@@ -2626,6 +2626,9 @@ file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
 /home/dominik/images/jupiter.jpg          @r{same as above}
 file:papers/last.pdf                      @r{file, relative path}
 ./papers/last.pdf                         @r{same as above}
+file:projects.org                         @r{another org file}
+file:projects.org::some words             @r{text search in org file}
+file:projects.org::*task title            @r{heading search in org file}
 news:comp.emacs                           @r{Usenet link}
 mailto:adent@@galaxy.net                 @r{Mail link}
 vm:folder                                 @r{VM folder link}



Thanks,
  Daniel



Daniel Clemente <n142857@gmail.com> writes:

> Ok, so it was [[file:proj.org::*some heading]] instead of [[file:proj.org#*some heading]], fine.
>
>   Could it be documented as example in http://orgmode.org/manual/External-links.html#External-links
>   This also refers to it: http://orgmode.org/manual/Publishing-links.html#Publishing-links
>
>
> Daniel

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

* Re: Re: Link to heading in another org file
  2009-01-19 15:36     ` Daniel Clemente
@ 2009-01-20  5:18       ` Carsten Dominik
  0 siblings, 0 replies; 11+ messages in thread
From: Carsten Dominik @ 2009-01-20  5:18 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: emacs-orgmode

Fixed, thanks.

- Carsten

On Jan 19, 2009, at 4:36 PM, Daniel Clemente wrote:

>
> Could this [[file proj.org::*some heading]] syntax be documented? I  
> attach a simple patch:
>
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -2626,6 +2626,9 @@ file:/home/dominik/images/jupiter.jpg      
> @r{file, absolute path}
> /home/dominik/images/jupiter.jpg          @r{same as above}
> file:papers/last.pdf                      @r{file, relative path}
> ./papers/last.pdf                         @r{same as above}
> +file:projects.org                         @r{another org file}
> +file:projects.org::some words             @r{text search in org file}
> +file:projects.org::*task title            @r{heading search in org  
> file}
> news:comp.emacs                           @r{Usenet link}
> mailto:adent@@galaxy.net                 @r{Mail link}
> vm:folder                                 @r{VM folder link}
>
>
>
> Thanks,
>  Daniel
>
>
>
> Daniel Clemente <n142857@gmail.com> writes:
>
>> Ok, so it was [[file:proj.org::*some heading]] instead of  
>> [[file:proj.org#*some heading]], fine.
>>
>>  Could it be documented as example in http://orgmode.org/manual/External-links.html#External-links
>>  This also refers to it: http://orgmode.org/manual/Publishing-links.html#Publishing-links
>>
>>
>> Daniel
>
>
> _______________________________________________
> 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] 11+ messages in thread

end of thread, other threads:[~2009-01-20  5:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14  8:59 Link to heading in another org file Daniel Clemente
2009-01-14 10:04 ` Tassilo Horn
2009-01-14 10:38   ` Daniel Clemente
2009-01-14 12:17     ` Tassilo Horn
2009-01-17 12:39       ` Carsten Dominik
2009-01-17 17:18         ` Tassilo Horn
2009-01-18  7:30           ` Carsten Dominik
2009-01-18  9:26             ` Tassilo Horn
2009-01-18 17:47               ` Carsten Dominik
2009-01-19 15:36     ` Daniel Clemente
2009-01-20  5:18       ` 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 NNTP newsgroup(s).