This is the mail archive of the
mailing list for the Cygwin project.
Re: Any progress on "Fork issues ith long command lines and long $PATH"?
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin at cygwin dot com
- Date: Wed, 20 Jan 2016 08:08:34 -0500
- Subject: Re: Any progress on "Fork issues ith long command lines and long $PATH"?
- Authentication-results: sourceware.org; auth=none
- References: <569E92D1 dot 9030506 at cornell dot edu> <641659872 dot 6133623 dot 1453246485856 dot JavaMail dot yahoo at mail dot yahoo dot com> <569EE230 dot 2060600 at cornell dot edu> <158550468 dot 20160120121946 at yandex dot ru>
On 1/20/2016 4:19 AM, Andrey Repin wrote:
Greetings, Ken Brown!
(2) I was using $USERPROFILE as an example. We have dozens of these
environment variables pointing to dozens directories. They enable us to
type in the same file name to emacs's find file (ctrl-x-ctrl-f) regardless
of who is logged in or which computer we are logged into (assuming that
every account has the same directory structure and propertly defined
environment variables). Yes we can manually translate them at a bash
prompt but this is a lot more typing, cutting and pasteing. We also share
the same .emacs file that contains thousands of file names that contain
these environment variables. We will really missing feature of native
The fact that C-x C-f expands environment variables is not a special
feature of native Windows emacs. But the expansion has to yield a valid
file name. In the case of Cygwin emacs, that means a Posix path.
Maybe you could write a script that uses cygpath to convert the relevant
environment variables to Posix paths, and then call this script from
I think it would be easier to just set Cygwin to use $USERPROFILE as $HOME.
Then $HOME would be a POSIX path you can use in the emacs config.
The OP stated that USERPROFILE is one of dozens of problematic
environment variables, so that wouldn't help.
Siegfried, if the script idea doesn't work for you, another possibility
is to solve your problem in elisp by using the function
cygwin-convert-file-name-from-windows, which exists in the Cygwin build
of emacs. For example, here's a snippet from server.el in the emacs
;; Allow Cygwin's emacsclient to be used as a file
;; handler on MS-Windows, in which case FILENAME
;; might start with a drive letter.
(when (and (fboundp 'cygwin-convert-file-name-from-windows)
(string-match "\\`[A-Za-z]:" file))
(setq file (cygwin-convert-file-name-from-windows file)))
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple