From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Importing from Oddmuse? Date: Mon, 28 Oct 2013 16:33:02 -0400 Message-ID: References: <526E7C4A.7050804@pfdstudio.com> <87y55dqn7s.fsf@Rainer.invalid> <526EACA0.3070709@pfdstudio.com> <87txg1qk5y.fsf@Rainer.invalid> <526EBC7C.5020403@pfdstudio.com> <87li1dqgz4.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7ba97f3ab380a004e9d301f3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VatUn-0005am-Ud for emacs-orgmode@gnu.org; Mon, 28 Oct 2013 16:33:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VatUm-0002XS-FX for emacs-orgmode@gnu.org; Mon, 28 Oct 2013 16:33:05 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:51081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VatUm-0002XA-82 for emacs-orgmode@gnu.org; Mon, 28 Oct 2013 16:33:04 -0400 Received: by mail-we0-f174.google.com with SMTP id u56so7198591wes.5 for ; Mon, 28 Oct 2013 13:33:02 -0700 (PDT) In-Reply-To: <87li1dqgz4.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: Achim Gratz Cc: emacs-orgmode@gnu.org --047d7ba97f3ab380a004e9d301f3 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 28, 2013 at 4:26 PM, Achim Gratz wrote: > Peter Davis writes: > > That was the first thing I tried, and Perl complained about an > > undefined variable. I may have made a typo though. > > Nope, my error. $1 gets clobbered by the second replacement. So you'd > want what you wrote or somewhat shorter: > > # hyperlinks > s/\[\[([^]]*)\]\]/ > my ($l, $o) = ($1, $1); > $l =~ s: :_:g; > "[[file:$l.org][$o]]"/gex; > > Yes, that works beautifully, and is nice and concise. Thank you! -pd -- ---- The Tech Curmudgeon http://www.techcurmudgeon.com --047d7ba97f3ab380a004e9d301f3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= On Mon, Oct 28, 2013 at 4:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
Peter Davis writes:
> That was the first thing I tried, and Perl complained about an
> undefined variable. I may have made a typo though.

Nope, my error. =A0$1 gets clobbered by the second replacement. =A0So= you'd
want what you wrote or somewhat shorter:

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





--
----
The Tech Curmudgeon

--047d7ba97f3ab380a004e9d301f3--