help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Unix utilities for Emacs on MS Windows


From: Ismael Valladolid Torres
Subject: Re: [h-e-w] Unix utilities for Emacs on MS Windows
Date: Wed, 23 Nov 2005 17:37:35 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915

Lennart Borgman wrote:

> If anyone have comments on those recommendations they are very welcome!
> I am still a bit unsure about Cygwin and would be glad for any comments.

It works lovely apart from a few unimportant glitches. Feel free to
suggest this snippet from my .emacs which suits perfectly my environment.

  (when (file-directory-p "C:/cygwin/bin")

    ;; Make NT Emacs use Cygwin bash, copied verbatim from Cygwin FAQ
    ;; at http://www.cygwin.com/faq/

    ;; This assumes that Cygwin is installed in C:\cygwin (the
    ;; default) and that C:\cygwin\bin is not already in your
    ;; Windows Path (it generally should not be).
    ;;
    (setq exec-path (cons "C:/cygwin/bin" exec-path))
    (setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH")))
    ;;
    ;; NT-emacs assumes a Windows command shell, which you change
    ;; here.
    ;;
    (setq process-coding-system-alist '(("bash" . undecided-unix)))
    (setq shell-file-name "bash")
    (setenv "SHELL" shell-file-name)
    (setq explicit-shell-file-name shell-file-name)
    ;;
    ;; This removes unsightly ^M characters that would otherwise
    ;; appear in the output of java applications.
    ;;
    (add-hook 'comint-output-filter-functions
              'comint-strip-ctrl-m)

    ;; Make NT Emacs understand Cygwin paths
    (when (locate-library "cygwin-mount")
      (require 'cygwin-mount)
      (cygwin-mount-activate)))

The cygwin-mount package makes Emacs aware of Cygwin mountpoints and
directories relative to its installation root, can be downloaded here:

http://www.emacswiki.org/cgi-bin/wiki/cygwin-mount.el

Also in .bashrc is useful to have something like this:

        [ -e "`which gnuclientw`" ] && alias emacs='gnuclientw'

So when running emacs from a shell, an existing Emacs process is reused
instead of opening a new one. It's a lot faster, but requires Guy
Gascoigne's Gnuserv to be installed. Can be found here:

http://www.wyrdrune.com/index.html?gnuserv.html~main

Just copy gnuserv.el to anywhere in your load-path, the executables to
anywhere in your PATH and include this in your .emacs:

  (when (and (locate-library "gnuserv") (executable-find "gnuserv"))
    (require 'gnuserv)
    (gnuserv-start))

Beware of software firewalls running on your Windows host, they could
make gnuclientw unable to connect to the gnuserv.

I hope this information is useful. Remember to give me credit if this
ends in your nice web page! :)

Cordially, Ismael
-- 
Dropping science like when Galileo dropped his orange

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]