This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Emacs, NT & cygwin bash



On Fri, 25 Feb 2000 stephane.decrauzat@conexant.com wrote:

> I am not sure if my question is more cygwin than emacs, but some of you might
> have faced (and solved) the same problem.

It's more of an emacs problem.  This was recently discussed in
gnu.emacs.help, in this thread and others:

From juliano@cs.unc.edu Thu Jan 27 15:37:41 2000
Newsgroups: gnu.emacs.help
Subject: help with exec-path, please


I'll reply here to put it in the search engine.  Followup to either
gnu.emacs.help or comp.emacs if you need more help.


> But the other commands ('grep', 'find-grep-dired', 'grep-find') where not
> working as the 'grep' and
> 'find' executed by emacs were not cygwins' but those form MS-DOS ;-(
> To correct this, I added my cygwin bin path as the first path in the emacs
> execution path
> (setq exec-path ...) but it did not work.

exec-path is not used for invoking these commands.  I've filed a bug
on the GNU emacs bug list.

You need to set your PATH correctly.


> Then I added the following lines to my .emacs
> 
>         ; to allow bash to be found
>         (setq exec-path (cons "c:/Progra~1/Cygnus/B20/cygwin~1/H-i586~1/bin"
>         exec-path))
> 
> and so the additional file .emacs_bash was sourced by the emacs
> shell (I could see that the first path in the emacs shell PATH
> variable was the cygwin bin path) but it did not worked neither.

What it did is not what you wanted it to do.  The documenation does
not make this clear.  I believe it should do what you expected, but it
doesn't.


> So then as a last test, I added the cygwin path as the first path in
> the NT system variable path (which is something that I don't want so
> as to prevent MS-DOS scripts to erroneously execute cygwin commands)
> and again the 'grep', 'find-grep-dired', 'grep-find' emacs commands
> did not work properly.

This should have worked.  I have this in my .emacs file:

       (setq explicit-shell-file-name
             "C:/Cygwin-1.0/bin/bash.exe")
       (setq shell-file-name
             "C:/Cygwin-1.0/bin/bash.exe")
       (let* ((cygpath1 "C:/Cygwin-1.0/bin")
              (cygpath2 "C:/Cygwin-1.0/usr/i686-cygwin/bin")
              (cygpath (list cygpath1 cygpath2)))
         (setq exec-path (append cygpath exec-path)))

and I typically run emacs from this bat file

    @echo off
    REM prepend cygwin bin dirs to PATH, then runemacs
    
    set CYGPATH0=D:\juliano_backup\bin
    set CYGPATH1=C:\Cygwin-1.0\bin;C:\Cygwin-1.0\usr\i686-cygwin\bin
    set CYGPATH2=C:\Cygwin-1.0\usr\local\bin;C:\Cygwin-1.0\contrib\bin
    set PATH=%CYGPATH0%;%CYGPATH1%;%CYGPATH2%;%PATH%
    
    "C:\Program Files\emacs-20.5\bin\runemacs.exe"

You can prepend PATH from your .emacs using the elisp funs setenv and
getenv.  I haven't tried it yet, so I don't know if that fixes your
problem.


Have you additionally followed the instructions (for making bash work)
in the NTemacs FAQ?

    http://www.gnu.org/software/emacs/windows/#shell-bash

I'm not sure if all of it is still correct/necessary.


hope this helps,

-jeff


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]