* command.com versus cmd.exe
@ 2002-09-12 10:27 Kai Großjohann
2002-09-12 11:03 ` Klaus Berndl
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-09-12 10:27 UTC (permalink / raw)
I don't use Windows myself, but I think that some versions of Windows
use command.com as interpreter for commands and others use cmd.exe.
Is this true?
If it is true, how would a Lisp package know which one to use?
shell-file-name? system-type?
kai
--
~/.signature is: umop 3p!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 10:27 command.com versus cmd.exe Kai Großjohann
@ 2002-09-12 11:03 ` Klaus Berndl
2002-09-12 11:50 ` Kai Großjohann
2002-09-12 12:50 ` Zhongtao Zhu
[not found] ` <mailman.1031834951.18415.help-gnu-emacs@gnu.org>
2 siblings, 1 reply; 11+ messages in thread
From: Klaus Berndl @ 2002-09-12 11:03 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 935 bytes --]
On Thu, 12 Sep 2002, Kai Großjohann wrote:
> I don't use Windows myself, but I think that some versions of Windows
> use command.com as interpreter for commands and others use cmd.exe.
> Is this true?
>
> If it is true, how would a Lisp package know which one to use?
> shell-file-name? system-type?
Do not know exactly but IMHO all modern Windows system use cmd.exe and only
old completely DOS-based 16 bit windows systems like Windows 3.11 use
command.com...but i'm not sure....
Please correct me!
But it should not matter because i would recommend to check the
environment-variable COMSPEC (which is set always be every windows system!),
maybe like follows:
If you need the command interpreter of windows with full path do:
,----
| (expand-file-name (getenv "COMSPEC"))
`----
If you only want the name of the interpreter do:
,----
| (file-name-nondirectory (expand-file-name (getenv "COMSPEC")))
`----
Ciao,
Klaus
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
--
Klaus Berndl mailto: klaus.berndl@sdm.de
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 11:03 ` Klaus Berndl
@ 2002-09-12 11:50 ` Kai Großjohann
2002-09-12 12:45 ` Klaus Berndl
2002-09-12 12:59 ` lawrence mitchell
0 siblings, 2 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-09-12 11:50 UTC (permalink / raw)
Klaus Berndl <Klaus.Berndl@raibau.raiffeisen.at> writes:
> But it should not matter because i would recommend to check the
> environment-variable COMSPEC (which is set always be every windows system!),
> maybe like follows:
Ah, I didn't know about COMSPEC. I now use the following code to
initialize the variable:
(if (memq system-type '(windows-nt))
(getenv "COMSPEC")
"/bin/sh")
Are there other values of system-type that I should check for?
kai
--
~/.signature is: umop 3p!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 11:50 ` Kai Großjohann
@ 2002-09-12 12:45 ` Klaus Berndl
2002-09-12 17:23 ` Jochen Küpper
2002-09-12 12:59 ` lawrence mitchell
1 sibling, 1 reply; 11+ messages in thread
From: Klaus Berndl @ 2002-09-12 12:45 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1523 bytes --]
On Thu, 12 Sep 2002, Kai Großjohann wrote:
> Klaus Berndl <Klaus.Berndl@raibau.raiffeisen.at> writes:
>
> > But it should not matter because i would recommend to check the
> > environment-variable COMSPEC (which is set always be every windows
> > system!), maybe like follows:
>
> Ah, I didn't know about COMSPEC. I now use the following code to
> initialize the variable:
>
> (if (memq system-type '(windows-nt))
> (getenv "COMSPEC")
> "/bin/sh")
> Are there other values of system-type that I should check for?
The info manual says for *system-type*:
,----
| ...
| `ms-dos'
| Microsoft MS-DOS "operating system." Emacs compiled with
| DJGPP for MS-DOS binds `system-type' to `ms-dos' even when
| you run it on MS-Windows.
| ...
`----
but i think today MS-DOS is not relevant anymore.
But i'm not sure about *cygwin32* as system-type. For the cygwin port of
recent XEmacs system-type is set to this value, don't know what value is set
for the cygwin port of GNU Emacs 21.2 (which seems to available now).
COMSPEC is also set for the cygwin-suite (because it "ingerits" the env-vars
of Windows) and it has normally the value "cmd.exe".
Because i do not know for which purpose you need the command-interpreter of
windows i can not say what is better for cygwin-ports of (X)Emacs: the value
of COMSPEC or "/bin/sh" (which is of course available on cygwin-systems)?!
Summary: Dependent of the usage you maybe want to check also for *cygwin32*!
Ciao,
Klaus
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
--
Klaus Berndl mailto: klaus.berndl@sdm.de
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 10:27 command.com versus cmd.exe Kai Großjohann
2002-09-12 11:03 ` Klaus Berndl
@ 2002-09-12 12:50 ` Zhongtao Zhu
[not found] ` <mailman.1031834951.18415.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 11+ messages in thread
From: Zhongtao Zhu @ 2002-09-12 12:50 UTC (permalink / raw)
Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> I don't use Windows myself, but I think that some versions of Windows
> use command.com as interpreter for commands and others use cmd.exe.
> Is this true?
>
> If it is true, how would a Lisp package know which one to use?
> shell-file-name? system-type?
In Emacs source tree there is a nt/ directory containing support for
compiling and running GNU Emacs on MS Windows 95/98/nt/xp. I'd like to
cite two paragraphs from cmdproxy.c as follows:
Accepts subset of Unix sh(1) command-line options, for
compatability with elisp code written for Unix. When possible,
executes external programs directly (a common use of /bin/sh by
Emacs), otherwise invokes the user-specified command processor to
handle built-in shell commands, batch files and interactive mode.
The main function is simply to process the "-c string" option in
the way /bin/sh does, since the standard Windows command shells use
the convention that everything after "/c" (the Windows equivalent
of "-c") is the input string.
I think this would be a hint to Kai's question.
By building Emacs from the nt/ directory in MS Windows, every thing
works successfully well. I now check the variable `shell-file-name' in
my machine it is set with "D:/emacs/bin/cmdproxy.exe".
In other experiment I've performed by net-install the pre-compiled
binaries without X11 in MS Windows, the installed Emacs when running
in cmd.exe seems insane since it cannot even be terminated by C-x
C-c. I wonder if this is exactly related to Kai's hesitation.
--
Zhongtao Zhu Tel: +86 10 6278 2266
Department of Computer, Tsinghua University, Beijing, China
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 11:50 ` Kai Großjohann
2002-09-12 12:45 ` Klaus Berndl
@ 2002-09-12 12:59 ` lawrence mitchell
2002-09-12 13:55 ` Kai Großjohann
2002-09-12 22:15 ` FRC
1 sibling, 2 replies; 11+ messages in thread
From: lawrence mitchell @ 2002-09-12 12:59 UTC (permalink / raw)
Kai Grossjohann wrote:
[...]
> Ah, I didn't know about COMSPEC. I now use the following code to
> initialize the variable:
> (if (memq system-type '(windows-nt))
> (getenv "COMSPEC")
> "/bin/sh")
How about (or (getenv "COMSPEC") "/bin/sh") ? Though I suppose
somebody might have defined an environment variable named COMSPEC
themselves.
> Are there other values of system-type that I should check for?
DOS and maybe (probably?) Cygwin I'd guess. What about OS/2?[1]
[1] Someone help me!
--
lawrence mitchell <wence@gmx.li>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
[not found] ` <mailman.1031834951.18415.help-gnu-emacs@gnu.org>
@ 2002-09-12 13:53 ` Kai Großjohann
2002-09-13 8:49 ` Klaus Berndl
0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2002-09-12 13:53 UTC (permalink / raw)
Zhongtao Zhu <zhongtao@tsinghua.edu.cn> writes:
> By building Emacs from the nt/ directory in MS Windows, every thing
> works successfully well. I now check the variable `shell-file-name' in
> my machine it is set with "D:/emacs/bin/cmdproxy.exe".
Cool, then I can just use that! Hm.
kai
--
~/.signature is: umop 3p!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 12:59 ` lawrence mitchell
@ 2002-09-12 13:55 ` Kai Großjohann
2002-09-12 22:15 ` FRC
1 sibling, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-09-12 13:55 UTC (permalink / raw)
lawrence mitchell <wence@gmx.li> writes:
> Kai Grossjohann wrote:
>
> [...]
>
>> Ah, I didn't know about COMSPEC. I now use the following code to
>> initialize the variable:
>
>> (if (memq system-type '(windows-nt))
>> (getenv "COMSPEC")
>> "/bin/sh")
>
> How about (or (getenv "COMSPEC") "/bin/sh") ? Though I suppose
> somebody might have defined an environment variable named COMSPEC
> themselves.
That looks like a good idea.
kai
--
~/.signature is: umop 3p!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 12:45 ` Klaus Berndl
@ 2002-09-12 17:23 ` Jochen Küpper
0 siblings, 0 replies; 11+ messages in thread
From: Jochen Küpper @ 2002-09-12 17:23 UTC (permalink / raw)
On 12 Sep 2002 14:45:55 +0200 Klaus Berndl wrote:
Klaus> But i'm not sure about *cygwin32* as system-type. For the
Klaus> cygwin port of recent XEmacs system-type is set to this value,
Klaus> don't know what value is set for the cygwin port of GNU Emacs
Klaus> 21.2 (which seems to available now).
emacs-21.2 on cygwin has
,----
| system-type's value is cygwin
|
| Documentation:
| Value is symbol indicating type of operating system you are using.
`----
Greetings,
Jochen
--
Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de
Liberté, Égalité, Fraternité GnuPG key: 44BCCD8E
Sex, drugs and rock-n-roll
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 12:59 ` lawrence mitchell
2002-09-12 13:55 ` Kai Großjohann
@ 2002-09-12 22:15 ` FRC
1 sibling, 0 replies; 11+ messages in thread
From: FRC @ 2002-09-12 22:15 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 790 bytes --]
My advice would be not to use (crappy) MS stuff whenever possible and stick
to the cygwin shells.
"lawrence mitchell" <wence@gmx.li> a écrit dans le message de news:
wkwuprxt1e.fsf@ID-97657.usr.dfncis.de...
> Kai Grossjohann wrote:
>
> [...]
>
> > Ah, I didn't know about COMSPEC. I now use the following code to
> > initialize the variable:
>
> > (if (memq system-type '(windows-nt))
> > (getenv "COMSPEC")
> > "/bin/sh")
>
> How about (or (getenv "COMSPEC") "/bin/sh") ? Though I suppose
> somebody might have defined an environment variable named COMSPEC
> themselves.
>
> > Are there other values of system-type that I should check for?
>
> DOS and maybe (probably?) Cygwin I'd guess. What about OS/2?[1]
>
> [1] Someone help me!
> --
> lawrence mitchell <wence@gmx.li>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: command.com versus cmd.exe
2002-09-12 13:53 ` Kai Großjohann
@ 2002-09-13 8:49 ` Klaus Berndl
0 siblings, 0 replies; 11+ messages in thread
From: Klaus Berndl @ 2002-09-13 8:49 UTC (permalink / raw)
On Thu, 12 Sep 2002, Kai Großjohann wrote:
> Zhongtao Zhu <zhongtao@tsinghua.edu.cn> writes:
>
> > By building Emacs from the nt/ directory in MS Windows, every thing
> > works successfully well. I now check the variable `shell-file-name' in
> > my machine it is set with "D:/emacs/bin/cmdproxy.exe".
>
> Cool, then I can just use that! Hm.
If you do not need the distinction between cmd.exe and command.com for special
purposes (do not know) nut only a mechanism to execute stuff with the
windows-system then you should definitely use cmdproxy.exe. I agree
completely with Zhongtao!
Klaus
--
Klaus Berndl mailto: klaus.berndl@sdm.de
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-09-13 8:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-12 10:27 command.com versus cmd.exe Kai Großjohann
2002-09-12 11:03 ` Klaus Berndl
2002-09-12 11:50 ` Kai Großjohann
2002-09-12 12:45 ` Klaus Berndl
2002-09-12 17:23 ` Jochen Küpper
2002-09-12 12:59 ` lawrence mitchell
2002-09-12 13:55 ` Kai Großjohann
2002-09-12 22:15 ` FRC
2002-09-12 12:50 ` Zhongtao Zhu
[not found] ` <mailman.1031834951.18415.help-gnu-emacs@gnu.org>
2002-09-12 13:53 ` Kai Großjohann
2002-09-13 8:49 ` Klaus Berndl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).