malabar-mode icon indicating copy to clipboard operation
malabar-mode copied to clipboard

cygwin provided emacs and pathing

Open jfoutz opened this issue 10 years ago • 5 comments

MavenProjectsCreator in MavenProjectHandler.groovy dosn't seem to be happy with paths like /cygdrive/c/work/...

I'm not sure if it's better handled in the mode or in the supporting jar.

Locally, I added this cheesy hack right in MavenProjectsCreator.create, which seemed to work. pom = pom.replace("/cygdrive/c", "c:")

I haven't dug into predicates for determining the environment - if you have some pointers for what to check, and where you want the code, I'd be willing to spend a couple hours putting together a patch, for the jar. I'm not as familiar with elisp, but if you outline the changes if it should happen on the mode side, i'm willing to take a crack at it.

jfoutz avatar Jan 14 '15 17:01 jfoutz

I think we should have the elisp account for it rather than forcing jar file to have to deal with it.

Are you using cygwin.el or some other cygwin support for emacs?

m0smith avatar Jan 15 '15 00:01 m0smith

Just the stock cygwin emacs install - if there's some package i should add, I will. FWIW, all the paths look unixish (/cygdrive/c/) from emacs' point of view. I'm running gradle under a cygwin console, but java of course is just making calls straight to windows, so it seems to need the c:/ style pathing in that one case.

Not to hijack the issue but, under cygwin, i checked out the jar project and do gradle run. I added (setq malabar-server-port 4429) to my init.el. I'm going to set malabar up on a mac this weekend - i'll try to document that and get you a pull request for the readme, but was hoping to verify that's the "right" way.

jfoutz avatar Jan 15 '15 00:01 jfoutz

Cygwin: I used to use the cygwin emacs but it crashed too much so I switched. There are some calls it provides for converting file names. I will get back to you.

Port 4429: It has been my plan to allow a person to do that very thing but I have not tried it myself. I would be very interested in knowing that it works :)

m0smith avatar Jan 15 '15 00:01 m0smith

If you look at the malabar-util.el there is a function commented out:

(defun malabar-util-expand-file-name (f &optional DEFAULT-DIRECTORY)
   (let ((rtnval (funcall malabar-util-path-filter 
             (expand-file-name f DEFAULT-DIRECTORY))))

     rtnval))

We should add this function back in with a new variable malabar-util-path-filter that is customizable. the default value should be 'identity unless (eq system-type 'cygwin) in which case it should be 'cygwin-convert-file-name-to-windows

Then calls to the http service should use malabar-util-expand-file-name instead of expand-file-name.

This will allow people to further customize the file name processing to get it into something java understands.

If you want to do that, feel free to create a pull request or I will get it taken care of soon.

m0smith avatar Jan 15 '15 01:01 m0smith

I'll dig in to that! I'm not promising today, but i'll try to get you something this weekend. Thanks very much.

jfoutz avatar Jan 15 '15 01:01 jfoutz