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

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

RE: [h-e-w] Some thoughts on using bash and cmd shells under emac s on W


From: Pirot, Thierry
Subject: RE: [h-e-w] Some thoughts on using bash and cmd shells under emac s on Win2k etc... and latex problem
Date: Fri, 12 Oct 2001 02:22:26 -0500

        Hello Jonathan, 

I knew the same problem as you did with latex. 
I traced the problem back to the fact that, 
in the path, cygwin/bin came before miktex/bin. 
First I avoided this precedence 
by settings in my nt environment variables, .emacs and .bashrc files. 
But the simplest workaround I found is 
to make 
        cygwin/bin/latex 
a shortcut to
        miktex/bin/latex.

A real solution would be to have cygwin's latex working and get rid of
miktex. 

Anyway your mails were very interesting to me. 

Two question: 

 1/ in .emacs what should we write 
(setq explicit-bash.exe-args '("-login" "-i"))  
or 
(setq explicit-bash.exe-args '("--login" "-i")) 

 2/ in which way the --color option in my aliased ls screw up emacs buffers
?


Take it Easy,
Don't worry,
Be happy,

        Thierry.

¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨

-----Original Message-----
From: Underwood, Jonathan [mailto:address@hidden
Sent: Thursday, 11 October, 2001 19:42
To: 'address@hidden'
Subject: [h-e-w] Some thoughts on using bash and cmd shells under emacs
on Win2k e tc.


Hi

I've been playing about trying to find some way of using both cygwins bash
and cmd.exe as shells under emacs, and the following points have arises. In
an ideal world, it would be nice to have two functions, one to set the shell
to cmd, the other to set it to bash. My motivation for doing this is that I
use cygwin for programming, but also use MikTex for latex, and i find that
if i set the shell to bash, then latex fails to function properly. Anyway,
i'm going around in circles with it somewhat, so i thought i'd air what
occurs to me here, and hope for any helpful comments :)

Here's what seems to be a fairly conventional way of setting bash as the
shell:

        (setq exec-path (append (list "c:/usr/cygwin/bin") exec-path))
        (setenv "PATH" (concat "C:/usr/cygwin/bin;" (getenv "PATH")))
        (setq process-coding-system-alist '(("bash" . undecided-unix)))
        (setq w32-quote-process-args ?\")

        (setq shell-file-name "bash")
        (setenv "SHELL" shell-file-name) 
        (setq explicit-shell-file-name shell-file-name) 

        (add-hook 'comint-output-filter-functions
                  'comint-strip-ctrl-m)

Now, this seems to me to be problematic in several ways:
1) Emacs, by invoking bash using bash.exe -c, runs a non-interactive shell.
That means, as stated in man bash, that the PATH variable is ignored. I'm
not sure why, but in reality this means that the PATH as set by windows
isn't in fact ignored, but any settings in the startup file, and this is why
the (setenv "PATH"..) line above is required. However, adding the cygwin/bin
directory to the PATH in this fashion then causes problems if you don't want
to have bash set as the shell (eg. if you swtich explicit-shell-name back to
"cmd") - for instance, it seems to be the adding of cygwin/bin to the path
which screws up latex.

2) far nicer would be to be able to provide the arguments "-i --login" to
bash to start bash interactively, such that the PATH variable would be set
and used correctly within bash. I've seen lines like
        (setq explicit-bash.exe-args '("-login" "-i"))  
in peoples .emacs files on the web, but this variable seems to be completely
undefined and so this doesn;t do anything (sadly). Unless i'm missing a
package?

3)In some ways it would be nice to have shell-file-name set to one shell and
explicit-shell-file-name set to another shell. This, i imagine opens up a
world of pain though.

Anyway, any thoughts greatfully received.

jonathan.




reply via email to

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