This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Help getting emacsclient working from Eclipse


I could use some help getting through a quoting problem.

I'm using Cygwin 1.5.25, Emacs 23.0.92.1, and Eclipse 3.5.1.

There's a "PathTools" plugin for Eclipse that lets me specify a command
line to open a file in an external editor, or open a shell in the
directory the file is in.  I have no trouble with the latter, but the
former gives me trouble when I try to use emacsclient to load the file
in my running Emacs.  I was able to get it to work with Textpad, but I'd
prefer to get emacsclient/emacs working.

As I got Textpad to work with this, it's clear that the wrinkle with
emacsclient is related to Cygwin, or perhaps emacsclient.  I've tried
numerous variations of the command line, but I still haven't found a way
to communicate the entire full path (which has spaces in it) to
emacsclient.

For instance, the command line which loads it into Textpad is just the
following ("{path-slashes}" is a marker for PathTools to substitute the
file path with forward slashes):

  cmd /C start textpad "{path-slashes}"

When I try to get this to work with emacsclient, nothing I have tried
ends up getting the full path to the file to emacsclient.  My current
command line is this:

  c:\cygwin\bin/bash -l -c "c:/cygwin/home/<myuid>/bin/emacsclienttocyg
"{path-slashes}""

where "emacsclienttocyg" is this:

#! /bin/bash
set -x
path="$@"
emacsclient -n -a textpad "$(cygpath -u "$path")"

When I run this command line in Eclipse, I see the following in the
Eclipse console:

-------------
c:\cygwin\bin/bash -l -c "c:/cygwin/home/<myuid>/bin/emacsclienttocyg
"C:/Documents and Settings/<myuid>/<remainder of path to file>""
+ path=C:/Documents
++ cygpath -u C:/Documents
+ emacsclient -n -a textpad /c/Documents
-------------

As you can see, only the first word of the path gets set into the "path"
variable.  I've tried numerous variations of quoting in the command
line, all of which fail for different reasons.

I'd appreciate any ideas.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]