[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[h-e-w] How to setup Cygwin/MSYS with Emacs
From: |
Lennart Borgman |
Subject: |
[h-e-w] How to setup Cygwin/MSYS with Emacs |
Date: |
Mon, 17 Oct 2005 15:33:49 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.7 (Windows/20050923) |
It has been working fine for me to use the GnuWin32 utilities with
Emacs. Now, trying to use JDEE and some other stuff, I need a Posix
style shell for Emacs on MS Windows. I have therefor had a second look
at Cygwin and MSYS to see if they can cooperate as nicely as the
GnuWin32 utilities with MS Windows.
The major headache is the line ending format wich is CRLF in Windows and
LF in *nix. MSYS have big troubles with this. Cygwin to some extent
tries to handle it. It can be installed so that files with text should
be read in "text mode" which means that lines can be read by most of the
programs that are reading text as - surprise - just lines, independent
of if the line ending is CRLF or LF. (Quite good, why should some
program reading text want to do it in another way? Is really CR a part
of a line in any text file of importance?)
Now that I have Cygwin using "text mode" I try to figure out what I need
to tell Emacs to use it. I want to use an Emacs that has been compiled
as a native MS Windows application. There is some information about this at
http://www.cygwin.com/faq/faq_3.html#SEC63
Comparing this with setup-cygwin.el from
http://www.emacswiki.org/cgi-bin/wiki/setup-cygwin.el shows some
confusing differences. For example the setup of
`process-coding-system-alist'. In setup-cygwin.el it is:
(setq process-coding-system-alist (cons '("bash" . (raw-text-dos .
raw-text-unix))
process-coding-system-alist))
The Cygwin page above instead has
(setq process-coding-system-alist '(("bash" . undecided-unix)))
(setq shell-file-name "bash")
The info node "(elisp) Default Coding Systems" says:
*Warning:* Coding systems such as `undecided', which determine the
coding system from the data, do not work entirely reliably with
asynchronous subprocess output. This is because Emacs handles
asynchronous subprocess output in batches, as it arrives.
It seems to me that undecided-unix is not correct here then, but can
someone who knows more than me about this please comment on this? (I
guess the shell is run as an async subprocess?) What should it actually
be? Does it depend on some setup in Cygwin? (I think I saw something
about pipes and binary vs text I/O?)
How should this be handled if MSYS is used instead?
And if there someday will be a GnuWin32 port of bash how should the
`process-coding-system-alist' be setup for that bash?
*********
Something that is even more confusing is that none of the sources above
mentions other programs like diff, grep etc. This then as far as I can
understand gets some default values. Why is this not good for bash too??
I guess these programs are run without starting bash explicitly? Is
there something going on behind the scene?
*********
Another small trouble: Both mentions `explicit-shell-file-name' which
does not seem to exist in CVS Emacs?
That is all for the moment... ;-)
- [h-e-w] How to setup Cygwin/MSYS with Emacs,
Lennart Borgman <=