emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to change a link?


From: Marcin Borkowski
Subject: Re: [O] How to change a link?
Date: Mon, 20 Oct 2014 02:02:09 +0200

On 2014-10-15, at 12:19, Nicolas Goaziou wrote:

> Hello,
>
> Marcin Borkowski <address@hidden> 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-property :type elt) '("custom-id" "fuzzy"))
>
>> 2. if it is, change it so that it points to the analogous place in
>> another file.
>
>   (org-element-put-property elt :raw-link
>                             (concat "file:path/to/other-file.org::"
>                                     (org-element-property :path elt)))

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 object (as opposed to a
property)?

> Regards,

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



reply via email to

[Prev in Thread] Current Thread [Next in Thread]