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