From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: regexp link on windows problem Date: Fri, 11 Mar 2011 09:45:01 +0100 Message-ID: <87r5aenj02.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=44404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxxyP-0008HZ-IH for emacs-orgmode@gnu.org; Fri, 11 Mar 2011 03:45:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxxyO-00023B-H9 for emacs-orgmode@gnu.org; Fri, 11 Mar 2011 03:45:25 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:53120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxxyO-000235-7c for emacs-orgmode@gnu.org; Fri, 11 Mar 2011 03:45:24 -0500 Received: by wyf19 with SMTP id 19so2576017wyf.0 for ; Fri, 11 Mar 2011 00:45:23 -0800 (PST) In-Reply-To: (Rafal Florek's message of "Tue, 08 Mar 2011 15:54:50 +0100") 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 Florek Cc: emacs-orgmode@gnu.org Hi Rafal, "Rafal Florek" writes: > The `org-insert-link' function destroys my regexp by changing all > backslashes to slashes. Can you give an example? > (I construct the regexp like this: (concat token1 "[ \\t]*" token2)) > It happens only under windows, under linux it is ok. > The culprit is the `expand-file-name' function, eg. > > for a C source line - a_struct.a_field = 1; > > on linux: > (expand-file-name "~/file.h::/a_struct[ \\t]*\\.[ \\t]*a_field[ \\t]*=[ > \\t]*1[ \\t]*;/")) > becomes: > /home/user/file.h::/a_struct[ \t]*\.[ \t]*a_field[ \t]*=[ \t]*1[ \t]*;/ > > on windows: > d:/Profiles/user/Application Data/file.h::/a_struct[ /t]*/.[ /t]*a_field[ > /t]*=[ /t]*1[ /t]*;/ AFAIK expand-file-name doesn't take a regexp as its argument. HTH, -- Bastien