1

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 !

user396409
  • 19
  • 1
  • 2
  • Can you be more specific with your question? What exactly do you mean by setting up? Do you already have a .emacs file? are you having trouble configuring the X Window parameters, etc. – Karra Nov 23 '11 at 11:17
  • Karra: that may have been slightly optimistic. – phils Nov 23 '11 at 11:52
  • See also this: http://stackoverflow.com/questions/2075504/how-to-best-integrate-emacs-and-cygwin – Jonathan Arkell Oct 26 '12 at 17:09

6 Answers6

3

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
    ))
chen bin
  • 568
  • 4
  • 16
3

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

Drew
  • 29,895
  • 7
  • 74
  • 104
  • `(require 'cygwin-mount)` is not necessary with current version of setup-cygwin.el (it's the first line in setup-cygwin.el) – Martin Schulze Mar 09 '12 at 19:44
1

Maybe try posting your question on http://superuser.com

But:

JohnB
  • 18,046
  • 16
  • 98
  • 110
1

You can find instructions here.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Anantha Kumaran
  • 10,101
  • 8
  • 33
  • 36
1

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.

slu
  • 1,244
  • 9
  • 14
0

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.

Joshz
  • 594
  • 5
  • 12