From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: regexp link on windows problem Date: Sun, 20 Mar 2011 18:01:50 +0100 Message-ID: <87d3ll4tfl.wl%dmaus@ictsoc.de> References: <87r5aenj02.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sun_Mar_20_18:01:50_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=43957 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1M0p-0006GW-Re for emacs-orgmode@gnu.org; Sun, 20 Mar 2011 13:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1M0o-0001nB-Iv for emacs-orgmode@gnu.org; Sun, 20 Mar 2011 13:01:55 -0400 Received: from mail.xlhost.de ([213.202.242.118]:42645 helo=mysql1.xlhost.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1M0o-0001me-9S for emacs-orgmode@gnu.org; Sun, 20 Mar 2011 13:01:54 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rafal Cc: emacs-orgmode@gnu.org --pgp-sign-Multipart_Sun_Mar_20_18:01:50_2011-1 Content-Type: text/plain; charset=US-ASCII At Fri, 11 Mar 2011 13:41:45 +0000 (UTC), Rafal wrote: > > Bastien 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.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Sun_Mar_20_18:01:50_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iF4EAREIAAYFAk2GMv4ACgkQma24O1pEeOYjHwEArjxfUZOrxm/5YxlJLCu8q3n5 htrj51f/KWb4xr2MdN8A/2E019/YhG7jPhjcSFo40C4Ounhg8ifzajj7mYEv3pUw =pHTh -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sun_Mar_20_18:01:50_2011-1--