Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Integrating Windows Emacs with Cygwin - how I got it working

1,454 views
Skip to first unread message

The Quiet Center

unread,
Feb 27, 2010, 5:11:58 AM2/27/10
to
I downloaded a patched Emacs called EmacsW32. Lennart Brogman created
this version of Emacs, but it still did not have the integration with
Cygwin that I needed.
For instance, it was not possible to type M-x grep-find and have a
working grep.

After googling about, I found an [excellent post on gnu.emacs.help]
(http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/
8f52d7f83dd0fb28/72c4d30d8603b4ee?lnk=gst&q=cygwin#72c4d30d8603b4ee)
by Drew Adams. I had to modify his instructions with something I found
at [the web sailor](http://www.khngai.com/emacs/cygwin.php).

To keep it simple, I’m going to give you the whole process:

– Install a [GNU Windows Emacs](http://ftp.gnu.org/gnu/emacs/windows/)
- Put these two files in your load-path: [cygwin mount](http://
www.emacswiki.org/cgi-bin/wiki/download/cygwin-mount.el) and [setup-
cygwin](http://www.emacswiki.org/cgi-bin/wiki/download/setup-
cygwin.el)
- Put this in your emacs init file and you’re done:


(if (and (eq system-type 'windows-nt)
(require 'cygwin-mount nil t))
(progn
(setenv "PATH" (concat "c:/cygwin/bin;" (getenv "PATH")))
(setq exec-path (cons "c:/cygwin/bin/" exec-path))
(require 'setup-cygwin)))

Lennart Borgman

unread,
Feb 27, 2010, 8:42:43 AM2/27/10
to The Quiet Center, help-gn...@gnu.org
On Sat, Feb 27, 2010 at 11:11 AM, The Quiet Center
<thequie...@gmail.com> wrote:
> I downloaded a patched Emacs called EmacsW32. Lennart Brogman created
> this version of Emacs, but it still did not have the integration with
> Cygwin that I needed.


It does not have any special cygwin integration.


> For instance, it was not possible to type M-x grep-find and have a
> working grep.


The installers for Emacs+EmacsW32 (patched or unpatched) comes with
grep and find so I believed this should work. You do not have to use
cygwin's grep and find (and I do not know if that works).

I am not using grep-find myself, only rgrep/lgrep. Can you please tell
us what did not work as expected?


The Quiet Center

unread,
Feb 27, 2010, 9:08:54 AM2/27/10
to
On Feb 27, 8:42 am, Lennart Borgman <lennart.borg...@gmail.com> wrote:
> On Sat, Feb 27, 2010 at 11:11 AM, The Quiet Center


>


> > For instance, it was not possible to type M-x grep-find and have a
> > working grep.
>
> The installers for Emacs+EmacsW32 (patched or unpatched) comes with
> grep and find so I believed this should work. You do not have to use
> cygwin's grep and find (and I do not know if that works).
>
> I am not using grep-find myself, only rgrep/lgrep. Can you please tell
> us what did not work as expected?

Well I didnt understand what to put on the command-line... here is
what comes up when type M-x grep-find

Run find (like this): grep -r <C> -nH . --include=

Lennart Borgman

unread,
Feb 27, 2010, 9:57:11 AM2/27/10
to The Quiet Center, help-gn...@gnu.org


Hm, thanks, looks like there is a bug there in Emacs+EmacsW32. The
normal default line should be

Run find (like this): find . -type f -print0 | xargs -0 -e grep -nH -e

I do not know what has happened. I have changed the use of grep in
rgrep/lgrep a bit because it works in my opinion using the -r argument
of grep, but perhaps I trashed something for grep-find. I will have a
look at that as soon as I can.

But I have some problems with nXhtml to fix first so it may be a while
before I can look at it more carefully. Just out of curiousity, do you
really need grep-find? Perhaps rgrep is enough?


The Quiet Center

unread,
Feb 27, 2010, 10:35:46 AM2/27/10
to
On Feb 27, 8:42 am, Lennart Borgman <lennart.borg...@gmail.com> wrote:


> I am not using grep-find myself, only rgrep/lgrep. Can you please tell
> us what did not work as expected?

ah, those two work fine!

however, access to a full cygwin is great because I can access all
sorts of cygwin binaries (git, ls, etc)

so, I will stick with plain Emacs for Windows and the two setup files
from emacswiki

thanks for your prompt response.

The Quiet Center

unread,
Feb 27, 2010, 10:39:00 AM2/27/10
to
On Feb 27, 9:57 am, Lennart Borgman <lennart.borg...@gmail.com> wrote:
> Just out of curiousity, do you
> really need grep-find? Perhaps rgrep is enough?

I never knew about rgrep. I've been using Emacs for 20 years and only
used M-x grep-find

but it's always nice to know about something new. And yes, it does
look like that does the same thing.

But standard Unix toolbox philosophy suggests piping together programs
with a fixed purpose instead of lumping together functionality in one
binary... but if I really thought that, I would be using emacs in the
first place ;-)

Lennart Borgman

unread,
Feb 27, 2010, 1:29:21 PM2/27/10
to The Quiet Center, help-gn...@gnu.org
On Sat, Feb 27, 2010 at 4:39 PM, The Quiet Center
<thequie...@gmail.com> wrote:
>
> But standard Unix toolbox philosophy suggests piping together programs
> with a fixed purpose instead of lumping together functionality in one
> binary... but if I really thought that, I would be using emacs in the
> first place ;-)


It is a die hard philosophy that makes things much harder than they
ought to be many times.

The said thing is that this really should be a philosophy for
libraries. I got some figures yesterday about the number of
overlapping libraries in GNU/Linux. I got it from a person that
decided to leave GNU/Linux since the overlapping libraries makes the
quality control impossible and therefore makes it hard for GNU/Linux
to move forward.


0 new messages