Re: [O] How to change a link?

2014-10-20 Thread Nicolas Goaziou
Nicolas Goaziou writes: > (org-with-wide-buffer > (dolist (link (nreverse > (org-element-map (org-element-parse-buffer) 'link > (lambda (l) > (member (org-element-property :type l) > '("cust

Re: [O] How to change a link?

2014-10-20 Thread Nicolas Goaziou
Marcin Borkowski writes: > OK, it works, but: if the link description is empty, after this change > it's still empty, so that it becomes the result of concatenation. I'd > like the link description to stay the same, no matter whether it's empty > or not. How do I set the /contents/ of a link ob

Re: [O] How to change a link?

2014-10-19 Thread Marcin Borkowski
On 2014-10-15, at 12:19, Nicolas Goaziou wrote: > Hello, > > Marcin Borkowski writes: > >> assume that I have a link object (e.g., I'm in the ellipsis part of >> this: >> >> (org-element-map (org-element-parse-buffer 'object) 'link >> (lambda (elt) ... )) >> >> What I want to do is this: >> 1.

Re: [O] How to change a link?

2014-10-18 Thread Thorsten Jolitz
Nick Dokos writes: > Marcin Borkowski writes: > >> On 2014-10-17, at 00:19, Thorsten Jolitz wrote: >> OK, so what is the canonical way of doing this? I don't want to use org-dp, since it is another dependency. >>> >>> It is a problem to add dependencies to libraries the user must inst

Re: [O] How to change a link?

2014-10-18 Thread Thorsten Jolitz
Marcin Borkowski writes: > On 2014-10-17, at 00:19, Thorsten Jolitz wrote: > >> However, here is a org-dp solution, use 't' instead of 'prepend to >> replace the links, and whatever you want instead of "file+emacs" as >> replacement. Of course one could easily re-search and replace "[[file:" >> i

Re: [O] How to change a link?

2014-10-17 Thread Marcin Borkowski
On 2014-10-17, at 00:19, Thorsten Jolitz wrote: > However, here is a org-dp solution, use 't' instead of 'prepend to > replace the links, and whatever you want instead of "file+emacs" as > replacement. Of course one could easily re-search and replace "[[file:" > in this simple case, but this uses

Re: [O] How to change a link?

2014-10-17 Thread Nick Dokos
Marcin Borkowski writes: > On 2014-10-17, at 00:19, Thorsten Jolitz wrote: > >>> OK, so what is the canonical way of doing this? I don't want to use >>> org-dp, since it is another dependency. >> >> It is a problem to add dependencies to libraries the user must install >> himself, and at the sam

Re: [O] How to change a link?

2014-10-17 Thread Marcin Borkowski
On 2014-10-17, at 00:19, Thorsten Jolitz wrote: >> OK, so what is the canonical way of doing this? I don't want to use >> org-dp, since it is another dependency. > > It is a problem to add dependencies to libraries the user must install > himself, and at the same time its a pity that there is so

Re: [O] How to change a link?

2014-10-16 Thread Thorsten Jolitz
Marcin Borkowski writes: > On 2014-10-15, at 23:52, Nicolas Goaziou wrote: > >> Marcin Borkowski writes: >> >>> I have one more question. What I'm about to do is (basically) put >>> "file:some-file-name::" in front of the link, without changing the >>> description. I could use `org-element-put

Re: [O] How to change a link?

2014-10-16 Thread Marcin Borkowski
On 2014-10-16, at 22:10, Nicolas Goaziou wrote: > Marcin Borkowski writes: > >> OK, so what is the canonical way of doing this? I don't want to use >> org-dp, since it is another dependency. > > There is no canonical way. I would personally collect a reverse list of > internal links and proceed

Re: [O] How to change a link?

2014-10-16 Thread Nicolas Goaziou
Marcin Borkowski writes: > OK, so what is the canonical way of doing this? I don't want to use > org-dp, since it is another dependency. There is no canonical way. I would personally collect a reverse list of internal links and proceed from there. Regards,

Re: [O] How to change a link?

2014-10-16 Thread Marcin Borkowski
On 2014-10-15, at 23:52, Nicolas Goaziou wrote: > Marcin Borkowski writes: > >> I have one more question. What I'm about to do is (basically) put >> "file:some-file-name::" in front of the link, without changing the >> description. I could use `org-element-put-property' and (AFAIU) >> org-elem

Re: [O] How to change a link?

2014-10-15 Thread Thorsten Jolitz
Thorsten Jolitz writes: > Marcin Borkowski writes: > >> On 2014-10-16, at 00:28, Thorsten Jolitz wrote: >> >>> Marcin Borkowski writes: >>> I see. What is the most interesting for me is the idea of getting/setting properties, that's what I was looking for. >>> >>> Thats exactly what

Re: [O] How to change a link?

2014-10-15 Thread Thorsten Jolitz
Marcin Borkowski writes: > On 2014-10-16, at 00:28, Thorsten Jolitz wrote: > >> Marcin Borkowski writes: >> >>> I see. What is the most interesting for me is the idea of >>> getting/setting properties, that's what I was looking for. >> >> Thats exactly what org-dp (https://github.com/tj64/org-d

Re: [O] How to change a link?

2014-10-15 Thread Marcin Borkowski
On 2014-10-16, at 00:28, Thorsten Jolitz wrote: > Marcin Borkowski writes: > >> I see. What is the most interesting for me is the idea of >> getting/setting properties, that's what I was looking for. > > Thats exactly what org-dp (https://github.com/tj64/org-dp) is about: > getting and setting

Re: [O] How to change a link?

2014-10-15 Thread Thorsten Jolitz
Marcin Borkowski writes: > I see. What is the most interesting for me is the idea of > getting/setting properties, that's what I was looking for. Thats exactly what org-dp (https://github.com/tj64/org-dp) is about: getting and setting element properties instead of working on the textual repres

Re: [O] How to change a link?

2014-10-15 Thread Nicolas Goaziou
Marcin Borkowski writes: > I have one more question. What I'm about to do is (basically) put > "file:some-file-name::" in front of the link, without changing the > description. I could use `org-element-put-property' and (AFAIU) > org-element-link-interpreter to put it into the buffer (and proba

Re: [O] How to change a link?

2014-10-15 Thread Marcin Borkowski
On 2014-10-15, at 12:19, Nicolas Goaziou wrote: > Hello, > > Marcin Borkowski writes: > >> assume that I have a link object (e.g., I'm in the ellipsis part of >> this: >> >> (org-element-map (org-element-parse-buffer 'object) 'link >> (lambda (elt) ... )) >> >> What I want to do is this: >> 1.

Re: [O] How to change a link?

2014-10-15 Thread Marcin Borkowski
On 2014-10-15, at 12:02, Thorsten Jolitz wrote: > Marcin Borkowski writes: > >> Thanks, but... >> >> 1. I have no org-dp-contents function in my Org. (Org-mode version >> 8.2.5f (8.2.5f-elpa @ /home/marcin/.emacs.d/elpa/org-20140116/)). > > org-dp.el (and org-dp-lib.el) are libraries of mine th

Re: [O] How to change a link?

2014-10-15 Thread Nicolas Goaziou
Hello, Marcin Borkowski writes: > assume that I have a link object (e.g., I'm in the ellipsis part of > this: > > (org-element-map (org-element-parse-buffer 'object) 'link > (lambda (elt) ... )) > > What I want to do is this: > 1. check whether it is an internal link, and (member (org-element

Re: [O] How to change a link?

2014-10-15 Thread Thorsten Jolitz
Marcin Borkowski writes: > On 2014-10-15, at 09:16, Thorsten Jolitz wrote: > >> Marcin Borkowski writes: >> >>> Hi list, >>> >>> assume that I have a link object (e.g., I'm in the ellipsis part of >>> this: >>> >>> (org-element-map (org-element-parse-buffer 'object) 'link >>> (lambda (elt) ...

Re: [O] How to change a link?

2014-10-15 Thread Marcin Borkowski
On 2014-10-15, at 09:16, Thorsten Jolitz wrote: > Marcin Borkowski writes: > >> Hi list, >> >> assume that I have a link object (e.g., I'm in the ellipsis part of >> this: >> >> (org-element-map (org-element-parse-buffer 'object) 'link >> (lambda (elt) ... )) >> >> What I want to do is this: >

Re: [O] How to change a link?

2014-10-15 Thread Thorsten Jolitz
Marcin Borkowski writes: > Hi list, > > assume that I have a link object (e.g., I'm in the ellipsis part of > this: > > (org-element-map (org-element-parse-buffer 'object) 'link > (lambda (elt) ... )) > > What I want to do is this: > 1. check whether it is an internal link, and > 2. if it is, c

[O] How to change a link?

2014-10-14 Thread Marcin Borkowski
Hi list, assume that I have a link object (e.g., I'm in the ellipsis part of this: (org-element-map (org-element-parse-buffer 'object) 'link (lambda (elt) ... )) What I want to do is this: 1. check whether it is an internal link, and 2. if it is, change it so that it points to the analogous pl