help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: case-sensitize filename


From: lode leroy
Subject: RE: case-sensitize filename
Date: Fri, 19 Sep 2008 09:27:09 +0200


> From: lennart.borgman@gmail.com
> lode leroy wrote:
>> I would like to know if there is an easy way to convert a file path
>> that has been converted to all-lowercase back to the properly cased version?
>> 
>> I have the following usecase:
>> 
>> cl /c C:\Projects\MyProject\MyProgramFile.cpp
>> c:\projects\myproject\myprogramfile.cpp(42): error C1234: 'CMyClass': 
>> undeclared
>> 
>> next-error -> c:\projects\myproject\myprogramfile.cpp
>> 
>> now next-error opens the correct file, but with the wrong buffer name ...
> 
> Looks like a bug somewhere. What version of Emacs are you using?

(GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-08-29 on LENNART-69DE564)

Well, for me, its a bug in vc90 (aka MS VisualC++ Express 2008)
which is reporting the error as being in file tolower(filename) rather then 
filename.

in the mean time, I found out that the following does what I want:

(defun filepath-transform-build-to-src (filepath)
  (progn
    (setq result (replace-regexp-in-string "\\\\build\\\\" "\\\\src\\\\" 
result))
    (setq result (expand-file-name result))
    (setq result (convert-standard-filename result))
    (setq result (file-truename result))
    result
    )
  )

(setq compilation-parse-errors-filename-function 
             'filepath-transform-build-to-src)

-- lode
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us



reply via email to

[Prev in Thread] Current Thread [Next in Thread]