Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to best integrate Emacs and Cygwin?

Tags:

bash

emacs

cygwin

There are a ton of ways to integrate Cygwin with Emacs on Windows. EmacsWiki shows a few ideas. Here are the options that I've found:

  1. Use the Emacs that comes with Cygwin. (Then find a way to get to cmd.exe if you want it.)
  2. Use NTEmacs and Cygwin as a "sometimes" shell. (A special command to launch Cygwin)
  3. Use NTEmacs and Cygwin as the "always" shell. (M-x shell launches cygwin)

To give some clarity as to "why". Here are a couple of examples where I wish I had Cygwin with Emacs:

  1. M-x whois doesn't work on NTEmacs.
  2. Packages like Wanderlust include a Makefile that isn't Windows friendly.
  3. Sometimes I just need a bash shell for something.

So which option of Emacs/Cygwin works well for others? Also, has anyone tried MSYS integration successfully?

like image 694
User1 Avatar asked Jan 15 '10 23:01

User1


People also ask

How do I use Emacs in Cygwin?

Install Emacs for Cygwin. Run the apropriate setup tool (as mentioned at https://cygwin.com/install.html) and select the Emacs package that you'd like to install. If you haven't installed Emacs before in Cygwin, choose "Not Installed" from the "View" and search for "emacs". Thanks.

Is Cygwin a bash?

The Cygwin installation creates a Bash shell along with a UNIX environment by which you can compile and run UNIX-like programs. Using this one can even create an emulated X server on your windows box and run UNIX-like GUI software tools.

How does Cygwin terminal work?

Cygwin is a collection of open source tools that allows Unix or Linux applications to be compiled and run on a Microsoft Windows operating system (OS) from within a Linux-like interface. Cygwin offers users a Linux-like experience in a Windows environment.


1 Answers

Use the Emacs in Cygwin. Not XEmacs..Emacs. I just install everything from Cygwin and type the following to run Emacs:

 XWin -multiwindow export DISPLAY=:0.0 emacs& 

It may also help to create a link to your C drive (or any other drive) like so:

ln -s /cygdrive/c /c

I've been using this for several months and it always works well. I constantly use advanced features like TRAMP and subversion without any issues. All advanced packages like cedet just work.

If you hadn't noticed, I am the original poster. After all of my research and attempts, this one worked and I am VERY PLEASED. Good job Cygwin!

Also, I recommend not using shell within Emacs. Utilities like top just don't seem to work. Instead, use MinTTY and screen. Cygwin gives you ssh directly in MinTTY (you don't need putty). The best part is that a lot of my Linux knowledge works seamlessly in Windows.

like image 174
User1 Avatar answered Sep 22 '22 09:09

User1