[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] regexp link on windows problem
From: |
David Maus |
Subject: |
Re: [O] regexp link on windows problem |
Date: |
Sun, 20 Mar 2011 18:01:50 +0100 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
At Fri, 11 Mar 2011 13:41:45 +0000 (UTC),
Rafal wrote:
>
> Bastien <bzg <at> altern.org> writes:
>
> Hi Bastien,
>
> >
> > Can you give an example?
> >
>
> So I'm trying to write a custom function to set regexp search string for c/c++
> code by writing org-create-file-search-functions hook. (code #1 below )
>
> After using the hook by issuing org-store-link in c/c++ buffer, and
> org-insert-link in org-mode buffer I noticed that the link has slashes instead
> of backslashes in my regexp.
> So I delved into the org-insert-link code and found out that it calls
> expand-file-name on the whole link (filename::regexp) which translates my
> regexp's backslashes to slashes. It happens only on emacs on windows,
> under linux it is ok.
> I also experimented by changing the culprit lines of org-store-link and
> it helped (code #2 below) but it seems to be too destructive.
> So I'm wondering if it is a bug that may be fixed or my way of doing
> it is wrong?
I suppose more a glitch. AFAIK there is currently no distinction
between real link target paths (files, directories etc.) and
expressions that would qualify as a query part of a link (e.g. like
the regexp).
Maybe fiddling with percent escaping (Cf. org-link-escape and
org-link-unescape) might provide a way to protect the slashes from
conversion.
Best,
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpvnu7ipM2I6.pgp
Description: PGP signature