* Link abbreviations, org-files with searches
@ 2011-10-31 11:36 Gustav Wikström
2011-10-31 12:10 ` suvayu ali
0 siblings, 1 reply; 8+ messages in thread
From: Gustav Wikström @ 2011-10-31 11:36 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 595 bytes --]
Hello!
When defining a link-abbreviation to an org-file with a headline search I
manage to get it to work with the following syntax:
#+LINK: foo file:/long/path/to/file/foo.org
[[foo::::*heading inside foo]]
I have to use four ":" to be able to search, instead of the three I would
expect (expecting three since the first ":" is used to declare that I want
to enter a tag and the following two are used inside the tag). Is this
intended behaviour?
Also, it only seems to work for headline-search. I cannot get the regular
search to work. Can someone confirm this behaviour?
/Gustav
[-- Attachment #2: Type: text/html, Size: 1015 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
2011-10-31 11:36 Link abbreviations, org-files with searches Gustav Wikström
@ 2011-10-31 12:10 ` suvayu ali
2011-10-31 12:33 ` Gustav Wikström
0 siblings, 1 reply; 8+ messages in thread
From: suvayu ali @ 2011-10-31 12:10 UTC (permalink / raw)
To: Gustav Wikström; +Cc: emacs-orgmode
Hello Gustav,
2011/10/31 Gustav Wikström <gustav.erik@gmail.com>:
> Hello!
> When defining a link-abbreviation to an org-file with a headline search I
> manage to get it to work with the following syntax:
> #+LINK: foo file:/long/path/to/file/foo.org
AFAIK, this is not required. Support for linking to org headlines is
already built in.
> [[foo::::*heading inside foo]]
This should be something like this:
[[file:/path/to/file.org::*<Heading_text>][Description]]
> I have to use four ":" to be able to search, instead of the three I would
> expect (expecting three since the first ":" is used to declare that I want
> to enter a tag and the following two are used inside the tag). Is this
> intended behaviour?
I am not sure what you are talking about here. Could you give an
example to illustrate?
> Also, it only seems to work for headline-search. I cannot get the regular
> search to work. Can someone confirm this behaviour?
For the regular search, something like this should be sufficient:
[[file:/path/to/file.org::<search_phrase>][Description]]
> /Gustav
Hope this helps.
PS: org-mode has amazing info documentation. Please check them out. All
of these are well covered there. For tutorials, you can check the
community site Worg.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
2011-10-31 12:10 ` suvayu ali
@ 2011-10-31 12:33 ` Gustav Wikström
2011-10-31 13:01 ` Suvayu Ali
0 siblings, 1 reply; 8+ messages in thread
From: Gustav Wikström @ 2011-10-31 12:33 UTC (permalink / raw)
To: suvayu ali; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2755 bytes --]
Hi Suvayu!
I know about the normal links and the possibility to search with these. The
thing is that I want to use an abbreviation (see sec. 4.6 in the manual) to
not have to type the path for this particular link every time.
Instead of typing (1)
[[file:/path/to/file.org::*<Heading_text>][Description]]
I want to be able to add an abbreviation in the beginning of the file the
link is in, with (2):
#+LINK: foo file:/long/path/to/file/foo.org
and then use this abbreviation later in the text with (3):
[[foo][Description]]
,and also be able to use searches with this abbreviation. And it is this
syntax that seems a bit cumbersome to use when adding headline-searching to
it (requiring four ":") and does not work when trying to use regular
search. Unless I'm doing something wrong.
I also know that I could add the "::%s" to the link, giving (4):
#+LINK: foo file:/long/path/to/file/foo.org::%s
but this makes it unusable as a simple file link without search. I intend
to use the link in multiple places inside my document both with and without
searches, thus I'm still wondering about this syntax-issue and the
non-headline search.
Regards
Gustav
(PS. sorry for the double-mail Suvayu. )
2011/10/31 suvayu ali <fatkasuvayu+linux@gmail.com>
> Hello Gustav,
>
> 2011/10/31 Gustav Wikström <gustav.erik@gmail.com>:
> > Hello!
> > When defining a link-abbreviation to an org-file with a headline search I
> > manage to get it to work with the following syntax:
> > #+LINK: foo file:/long/path/to/file/foo.org
>
> AFAIK, this is not required. Support for linking to org headlines is
> already built in.
>
> > [[foo::::*heading inside foo]]
>
> This should be something like this:
>
>
> [[file:/path/to/file.org::*<Heading_text>][Description]]
>
> > I have to use four ":" to be able to search, instead of the three I would
> > expect (expecting three since the first ":" is used to declare that I
> want
> > to enter a tag and the following two are used inside the tag). Is this
> > intended behaviour?
>
> I am not sure what you are talking about here. Could you give an
> example to illustrate?
>
> > Also, it only seems to work for headline-search. I cannot get the regular
> > search to work. Can someone confirm this behaviour?
>
> For the regular search, something like this should be sufficient:
>
> [[file:/path/to/file.org::<search_phrase>][Description]]
>
> > /Gustav
>
> Hope this helps.
>
> PS: org-mode has amazing info documentation. Please check them out. All
> of these are well covered there. For tutorials, you can check the
> community site Worg.
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>
[-- Attachment #2: Type: text/html, Size: 5014 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
2011-10-31 12:33 ` Gustav Wikström
@ 2011-10-31 13:01 ` Suvayu Ali
2011-10-31 13:55 ` Gustav Wikström
0 siblings, 1 reply; 8+ messages in thread
From: Suvayu Ali @ 2011-10-31 13:01 UTC (permalink / raw)
To: Gustav Wikström; +Cc: emacs-orgmode
On Mon, 31 Oct 2011 13:33:31 +0100
Gustav Wikström <gustav.erik@gmail.com> wrote:
> Hi Suvayu!
>
> I know about the normal links and the possibility to search with
> these. The thing is that I want to use an abbreviation (see sec. 4.6
> in the manual) to not have to type the path for this particular link
> every time.
>
> Instead of typing (1)
>
> [[file:/path/to/file.org::*<Heading_text>][Description]]
>
> I want to be able to add an abbreviation in the beginning of the file
> the link is in, with (2):
>
> #+LINK: foo file:/long/path/to/file/foo.org
>
> and then use this abbreviation later in the text with (3):
>
> [[foo][Description]]
>
Okay now I follow you. I believe you are misunderstanding the syntax.
It should be like this (copying from my test example):
#+LINK: odir file:~/org/coding.org::
[[odir:Distributed%20analysis][Distributed analysis]]
[[odir:#ganga][Ganga]]
That said I had trouble getting the search to work with org files but I
will admit I did not try hard enough.
> ,and also be able to use searches with this abbreviation. And it is
> this syntax that seems a bit cumbersome to use when adding
> headline-searching to it (requiring four ":") and does not work when
> trying to use regular search. Unless I'm doing something wrong.
>
> I also know that I could add the "::%s" to the link, giving (4):
>
> #+LINK: foo file:/long/path/to/file/foo.org::%s
>
> but this makes it unusable as a simple file link without search. I
> intend to use the link in multiple places inside my document both
> with and without searches, thus I'm still wondering about this
> syntax-issue and the non-headline search.
>
How is it unusable? Shouldn't the following work with the above setting?
[[foo:<search_string>][Description]]
[[foo:*<Headline_string>][Description]]
Of course I didn't have the time to test this variation, so indeed there
could be a bug. :-p
> Regards
> Gustav
>
> (PS. sorry for the double-mail Suvayu. )
>
No worries. Hope the above suggestions help.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
2011-10-31 13:01 ` Suvayu Ali
@ 2011-10-31 13:55 ` Gustav Wikström
2011-10-31 14:09 ` Suvayu Ali
0 siblings, 1 reply; 8+ messages in thread
From: Gustav Wikström @ 2011-10-31 13:55 UTC (permalink / raw)
To: Suvayu Ali; +Cc: emacs-orgmode
2011/10/31 Suvayu Ali <fatkasuvayu+linux@gmail.com>:
...
>> I also know that I could add the "::%s" to the link, giving (4):
>>
>> #+LINK: foo file:/long/path/to/file/foo.org::%s
>>
>> but this makes it unusable as a simple file link without search. I
>> intend to use the link in multiple places inside my document both
>> with and without searches, thus I'm still wondering about this
>> syntax-issue and the non-headline search.
>>
>
> How is it unusable? Shouldn't the following work with the above setting?
>
> [[foo:<search_string>][Description]]
> [[foo:*<Headline_string>][Description]]
>
> Of course I didn't have the time to test this variation, so indeed there
> could be a bug. :-p
This works when adding "::" to the end of the link. But with this
setting I cannot use the link as a simple file-link, eg. the following
does not work:
#+LINK: foo file:/long/path/to/file/foo.org::
[[foo][Description]]
When trying to follow this link I get an error saying that there is
"no such file: /long/path/to/file/foo.org::"
/Gustav
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
2011-10-31 13:55 ` Gustav Wikström
@ 2011-10-31 14:09 ` Suvayu Ali
[not found] ` <CA+SyOP_+ywn8d5n-bngggc9LYSyZGNpiD3yvLbt=id7P=zmvmQ@mail.gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Suvayu Ali @ 2011-10-31 14:09 UTC (permalink / raw)
To: Gustav Wikström; +Cc: emacs-orgmode
Hi Gustav,
On Mon, 31 Oct 2011 14:55:27 +0100
Gustav Wikström <gustav.erik@gmail.com> wrote:
> This works when adding "::" to the end of the link. But with this
> setting I cannot use the link as a simple file-link, eg. the following
> does not work:
>
> #+LINK: foo file:/long/path/to/file/foo.org::
> [[foo][Description]]
>
> When trying to follow this link I get an error saying that there is
> "no such file: /long/path/to/file/foo.org::"
Of course that won't work! The resulting link is not a valid link
syntax. Since you don't specify a tag, the final link looks like this:
[[file:/path/to/file.org::]]
which is incorrect.
From a test the following worked nicely.
#+LINK: odir2 file:~/org/coding.org
[[odir2][link to file]]
So in conclusion, if you want to use both bare file/directory links as
well as headline/search links, you would have to define two separate
link shortcuts.
Hope that helps.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
[not found] ` <CA+SyOP_+ywn8d5n-bngggc9LYSyZGNpiD3yvLbt=id7P=zmvmQ@mail.gmail.com>
@ 2011-10-31 17:50 ` Gustav Wikström
2011-10-31 21:00 ` Gustav Wikström
0 siblings, 1 reply; 8+ messages in thread
From: Gustav Wikström @ 2011-10-31 17:50 UTC (permalink / raw)
To: Suvayu Ali, emacs-orgmode
2011/10/31 Suvayu Ali <fatkasuvayu+linux@gmail.com>:
> Hi Gustav,
>
> On Mon, 31 Oct 2011 14:55:27 +0100
> Gustav Wikström <gustav.erik@gmail.com> wrote:
>
>> This works when adding "::" to the end of the link. But with this
>> setting I cannot use the link as a simple file-link, eg. the following
>> does not work:
>>
>> #+LINK: foo file:/long/path/to/file/foo.org::
>> [[foo][Description]]
>>
>> When trying to follow this link I get an error saying that there is
>> "no such file: /long/path/to/file/foo.org::"
>
> Of course that won't work! The resulting link is not a valid link
> syntax. Since you don't specify a tag, the final link looks like this:
>
> [[file:/path/to/file.org::]]
>
> which is incorrect.
>
> From a test the following worked nicely.
>
> #+LINK: odir2 file:~/org/coding.org
>
> [[odir2][link to file]]
>
> So in conclusion, if you want to use both bare file/directory links as
> well as headline/search links, you would have to define two separate
> link shortcuts.
Yes, I'm aware of this. And this is the reason of my initial question.
Should it really be necessary to specify two separate links to the
same file when I want to both link to the file directly and link it
with a search?
Thus, this works:
#+LINK: foo file:/long/path/to/file/foo.org
[[foo::::*<heading search>]]
but this does not:
#+LINK: foo file:/long/path/to/file/foo.org
[[foo::::<search>]]
I find the use of four ":" a bit strange, but I guess this is only a
limit of my understanding a.t.m. In my view the first colon should be
stating the start of the "tag" and the rest of the string the tag
itself. This leaves three colons for the tag which in my view is one
to many. But it seems to work. And this is what I'm scratching my head
about.
I also suspect a bug hidden somewhere, since headlines can be searched
for but not text inside the document.
Anyone got any input on this?
/Gustav
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Link abbreviations, org-files with searches
2011-10-31 17:50 ` Gustav Wikström
@ 2011-10-31 21:00 ` Gustav Wikström
0 siblings, 0 replies; 8+ messages in thread
From: Gustav Wikström @ 2011-10-31 21:00 UTC (permalink / raw)
To: Suvayu Ali, emacs-orgmode
I did some digging and ended at the function org-link-expand-abbrev.
According to the org-documentation, abbreviations should be written with:
[[linkword:tag]]
however the regular expression doing the matching in the function also
allows the following:
[[linkword::tag]]
The greed of the regular expression makes it a requirement to use four
colons when using abbreviation and search. Also, all types of
searching works, not only the headline-search as I stated earlier.
Just wanted to clear this out
/Gustav
2011/10/31 Gustav Wikström <gustav.erik@gmail.com>:
> 2011/10/31 Suvayu Ali <fatkasuvayu+linux@gmail.com>:
>> Hi Gustav,
>>
>> On Mon, 31 Oct 2011 14:55:27 +0100
>> Gustav Wikström <gustav.erik@gmail.com> wrote:
>>
>>> This works when adding "::" to the end of the link. But with this
>>> setting I cannot use the link as a simple file-link, eg. the following
>>> does not work:
>>>
>>> #+LINK: foo file:/long/path/to/file/foo.org::
>>> [[foo][Description]]
>>>
>>> When trying to follow this link I get an error saying that there is
>>> "no such file: /long/path/to/file/foo.org::"
>>
>> Of course that won't work! The resulting link is not a valid link
>> syntax. Since you don't specify a tag, the final link looks like this:
>>
>> [[file:/path/to/file.org::]]
>>
>> which is incorrect.
>>
>> From a test the following worked nicely.
>>
>> #+LINK: odir2 file:~/org/coding.org
>>
>> [[odir2][link to file]]
>>
>> So in conclusion, if you want to use both bare file/directory links as
>> well as headline/search links, you would have to define two separate
>> link shortcuts.
>
> Yes, I'm aware of this. And this is the reason of my initial question.
> Should it really be necessary to specify two separate links to the
> same file when I want to both link to the file directly and link it
> with a search?
>
> Thus, this works:
>
> #+LINK: foo file:/long/path/to/file/foo.org
> [[foo::::*<heading search>]]
>
> but this does not:
>
> #+LINK: foo file:/long/path/to/file/foo.org
> [[foo::::<search>]]
>
> I find the use of four ":" a bit strange, but I guess this is only a
> limit of my understanding a.t.m. In my view the first colon should be
> stating the start of the "tag" and the rest of the string the tag
> itself. This leaves three colons for the tag which in my view is one
> to many. But it seems to work. And this is what I'm scratching my head
> about.
>
> I also suspect a bug hidden somewhere, since headlines can be searched
> for but not text inside the document.
>
> Anyone got any input on this?
> /Gustav
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-10-31 21:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 11:36 Link abbreviations, org-files with searches Gustav Wikström
2011-10-31 12:10 ` suvayu ali
2011-10-31 12:33 ` Gustav Wikström
2011-10-31 13:01 ` Suvayu Ali
2011-10-31 13:55 ` Gustav Wikström
2011-10-31 14:09 ` Suvayu Ali
[not found] ` <CA+SyOP_+ywn8d5n-bngggc9LYSyZGNpiD3yvLbt=id7P=zmvmQ@mail.gmail.com>
2011-10-31 17:50 ` Gustav Wikström
2011-10-31 21:00 ` Gustav Wikström
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.