Web lists-archives.com

Re: [Mingw-msys] Re: Howto obtain a full Windows path from a shell command?

  On 04/10/2010 09:38 AM, Keith Marshall wrote:
> On Saturday 10 April 2010 11:26:51 Vincent Torri wrote:
>> On Fri, 9 Apr 2010, David A. Cobb wrote:
>>>   On one Windows machine, I have both Cygwin and MingW32+MSYS
>>> installed.  To go with it, I have both Cygwin and Windows native
>>> emacsen. On the native system, I find using MS cmd.exe as the
>>> shell is sub-optimal. Would it be possible to set up MSYS as the
>>> shell?
>> in MSYS, the shell is actually bash.
> Yes, it is, but in a standard MSYS installation we normally start it
> in `sh compatibility' mode.
>> Iirc, there is no possible way to do what you want.
> Maybe; maybe not.  Depending on how your native MSW emacs invokes a
> shell, it may be just a matter of making the COMSPEC variable, (in
> the environment), point to the MSYS shell; try starting emacs from
> the MSYS shell itself, with a command such as:--
>    $ COMSPEC=/bin/sh.exe path/to/emacs ...
> (This should work, if emacs uses a `system()' call, resolved through
> MSVCRT.DLL, as would be the case if built using MinGW, or any other
> compiler suite which uses this, or a derivative runtime).

What I've done so far, after examining the code in emacs "shell.el" 
library, is this:
 From the MSYS console, " $ emacs ..." invokes a  small sh script.  The 
script sets, especially,

>> Use either the DOS console or the MSYS console (without rxvt)
> Huh?  Certainly, avoid RXVT like the plague; use a native Win32
> console, either standalone, or driven through Console2.

Please, please, why??  I quite like RXVT and I don't see any problems 
with it.  But what is "Console2".

>>> This is part of a more-general question.  How can an application
>>> tell whether it was launched by MSYS?  There are some tools I
>>> want to make behave appropriately to the environment I'm working
>>> in.
>> get the value of the environment variable "TERM".
> $TERM isn't really a good choice for identifying an MSYS environment,
> (it is too ubiquitous); something MSYS specific, such as $MSYSTEM,
> would surely be a better choice.

I agree, TERM was not a great choice for the MSYS folks.  MSYSTEM would 
be  good but require more emacs hacking than I'm ready to do yet.  As I 
said above, ESHELL is the magic word for the emacs shell library.

IMNSHO, however, the _right_ choice would be to set "MACHTYPE" to 
whatever a configure scriipt expects when parsing an MSYS build.  It's 
no "trick" at all -- MACHTYPE already has the desired semantics.

David A. Cobb -- computing t-rex

Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
Mingw-msys mailing list