From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Importing from Oddmuse? Date: Mon, 28 Oct 2013 14:27:44 -0400 Message-ID: <526EACA0.3070709@pfdstudio.com> References: <526E7C4A.7050804@pfdstudio.com> <87y55dqn7s.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------030807000902030704030200" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VarXc-0002Ze-TX for emacs-orgmode@gnu.org; Mon, 28 Oct 2013 14:27:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VarXY-0008P2-71 for emacs-orgmode@gnu.org; Mon, 28 Oct 2013 14:27:52 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VarXX-0008Os-VJ for emacs-orgmode@gnu.org; Mon, 28 Oct 2013 14:27:48 -0400 In-Reply-To: <87y55dqn7s.fsf@Rainer.invalid> 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------030807000902030704030200 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/28/13, 2:12 PM, Achim Gratz wrote: > Peter Davis writes: >> # hyperlinks >> s/\[\[([^]]*)\]\]/[[file:$1.org][$1]]/g; > Try this to fix the links maybe: > > # hyperlinks > s/\[\[([^]]*)\]\]/ > my $l = $1; > $l =~ s: :_:g; > "[[file:$l.org][$l]]"/gex; Excellent! I modified it slightly to keep the spaces in the display string: # hyperlinks s/\[\[([^]]*)\]\]/ my $l = $1; my $orig = $1; $l =~ s: :_:g; "[[file:$l.org][$orig]]"/gex; Thanks, Achim! -pd -- ---- Peter Davis The Tech Curmudgeon www.techcurmudgeon.com --------------030807000902030704030200 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 10/28/13, 2:12 PM, Achim Gratz wrote:
Peter Davis writes:
	    # hyperlinks
	    s/\[\[([^]]*)\]\]/[[file:$1.org][$1]]/g;
Try this to fix the links maybe:

 	    # hyperlinks
 	    s/\[\[([^]]*)\]\]/
            my $l = $1;
            $l =~ s: :_:g;
            "[[file:$l.org][$l]]"/gex;

Excellent! I modified it slightly to keep the spaces in the display string:

         # hyperlinks
         s/\[\[([^]]*)\]\]/
         my $l = $1;
         my $orig = $1;
         $l =~ s: :_:g;
         "[[file:$l.org][$orig]]"/gex;

Thanks, Achim!

-pd

-- 
----
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com
--------------030807000902030704030200--