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 !

3
  • 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, 2011 at 11:17
  • Karra: that may have been slightly optimistic.
    – phils
    Nov 23, 2011 at 11:52
  • See also this: stackoverflow.com/questions/2075504/… Oct 26, 2012 at 17:09

6 Answers 6

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

1
  • (require 'cygwin-mount) is not necessary with current version of setup-cygwin.el (it's the first line in setup-cygwin.el) Mar 9, 2012 at 19:44
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
    ))
1

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

But:

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.

1

You can find instructions here.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.