user396409
user396409

Reputation: 19

Emacs + Cygwin setup under windows !

I just downloaded Emacs and Cygwin for Windows(Vista in my case). Have no idea how to set them up.

Any help would be appreciated ! Thanks !

Upvotes: 1

Views: 7700

Answers (6)

Anantha Kumaran
Anantha Kumaran

Reputation: 10389

You can find instructions here.

Upvotes: 1

Joshz
Joshz

Reputation: 626

There're several way to integrate emacs with cygwin as follows:

  1. emacs-nox under cygwin. Not attractive!
  2. emacs-X11 under cygwin. An X server is needed like XMing or Cygwin/X. A bit slow and heavy.
  3. emacs-w32 under cygwin.
  4. emacs under windows. You need some configuration to make emacs recognize the cygwin environment. Difficult for beginners.

I'd recommend using emacs-w32 with cygwin, which uses native Windows GUI so that you don't have to start an xserver just to run emacs and you don't need to write/download any tricky code to make emacs aware of cygwin env as other answers do.

Just install emacs-w32 and run it from mintty and here you go. FYI, if you want to start emacs "independently", write a .bat file with D:\cygwin\bin\run.exe /usr/bin/bash.exe --login -i -c /usr/bin/emacs-w32.exe inside or, as I do, write a .ahk script to start emacs with hotkey F12.

Upvotes: 0

chen bin
chen bin

Reputation: 568

Step 1: Install libraries

http://www.emacswiki.org/emacs/cygwin-mount.el

http://www.emacswiki.org/emacs/setup-cygwin.el

Step 2: Install cygwin to C:\cygwin (This requirement is hardcoded in setup-cygwin.el, so just do it unless you are willing to modify setup-cygwin.el).

Step 3: Add following code into your .emacs or .emacs.d/init.el. Please note the variable cygwin-mount-cygwin-bin-directory is not set by default in cygwin-mount.el, I suggest using hard coded path (I mean "c:/cygwin/bin" actually) since the cygwin install path is already hardcoded by setup-cygwin.el.

(setq *win32* (eq system-type 'windows-nt) )
;; win32 auto configuration, assuming that cygwin is installed at "c:/cygwin"
(if *win32*
(progn
    (setq cygwin-mount-cygwin-bin-directory "c:/cygwin/bin")
    (require 'setup-cygwin)
    ;(setenv "HOME" "c:/cygwin/home/someuser") ;; better to set HOME env in GUI
    ))

Upvotes: 3

Drew
Drew

Reputation: 30699

I use these libraries, in this order:

(require 'cygwin-mount)
(require 'setup-cygwin)

They are both available on EmacsWiki:

http://www.emacswiki.org/emacs/cygwin-mount.el

http://www.emacswiki.org/emacs/setup-cygwin.el

Upvotes: 3

slu
slu

Reputation: 1325

Use cygwin-mount.el to integrate Cygwin with Emacs:

You might also want to replace the DOS Shell with the Cygwin bash, that's also covered.

Upvotes: 1

Related Questions