From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: How to change a link? Date: Mon, 20 Oct 2014 02:02:09 +0200 Message-ID: <87h9yzobge.fsf@wmi.amu.edu.pl> References: <87a94yjia9.fsf@wmi.amu.edu.pl> <87bnpd4ov7.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg0Qk-0003ZB-Lg for emacs-orgmode@gnu.org; Sun, 19 Oct 2014 20:02:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xg0Qe-0005Zm-Vz for emacs-orgmode@gnu.org; Sun, 19 Oct 2014 20:02:34 -0400 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:60568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg0Qe-0005V9-OE for emacs-orgmode@gnu.org; Sun, 19 Oct 2014 20:02:28 -0400 Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id D99FD41464 for ; Mon, 20 Oct 2014 02:02:25 +0200 (CEST) Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Stex7U7DUp-i for ; Mon, 20 Oct 2014 02:02:25 +0200 (CEST) Received: from localhost (99-229.echostar.pl [213.156.99.229]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 541B241460 for ; Mon, 20 Oct 2014 02:02:25 +0200 (CEST) In-reply-to: <87bnpd4ov7.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode List 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. 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