Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?UTF-8?B?UmFmYWwgRmxvcmVr?= <raf <at> irmak.com.pl>
Subject: [O] regexp link on windows problem
Newsgroups: gmane.emacs.orgmode
Date: Tuesday 8th March 2011 14:54:50 UTC (over 5 years ago)
´╗┐Hello,

While writing custom function to set regexp search string for c/c++ code I

stumbled upon a backslash to slash translation problem.
The `org-insert-link' function destroys my regexp by changing all 
backslashes to slashes. 
(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]*;/

Is this an expected behavior or a bug? Can you recommend a solution or a 
workaround?

regards,
Rafal
 
CD: 3ms