From owner-ntemacs-users@june  Mon Sep 23 08:59:22 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "23" "September" "1996" "11:07:21" "-0400" "Michael Welsh Duggan" "md5i@schenley.com" nil "30" "Re: Emacs 19.34: ^M in (bash) shell buffer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id IAA28608 for <voelker@june.cs.washington.edu>; Mon, 23 Sep 1996 08:59:21 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id IAA32043 for <voelker@joker.cs.washington.edu>; Mon, 23 Sep 1996 08:59:20 -0700
Received: from maru.schenley.com (maru.schenley.com [206.62.188.70]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id IAA26035 for <ntemacs-users@cs.washington.edu>; Mon, 23 Sep 1996 08:07:36 -0700
Received: by maru.schenley.com from localhost     (router,SLmailNT V2.0); Mon, 23 Sep 1996 11:07:23 EDT
Received: by maru.schenley.com from maru.schenley.com     (127.0.0.1::mail daemon; unverified,SLmailNT V2.0); Mon, 23 Sep 1996 11:07:22 EDT
References: <9609231237.AA25360@osfsrv.shr.dec.com>
In-Reply-To: preilly@ROKCHR.shr.dec.com's message of Mon, 23 Sep 1996 08:37:35 -0400
Message-ID: <uiv95nuc6.fsf@maru.schenley.com>
Lines: 30
X-Mailer: Gnus v5.2.37/Emacs 19.32
From: "Michael Welsh Duggan" <md5i@schenley.com>
Sender: "Michael Welsh Duggan" <md5i@schenley.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: Emacs 19.34: ^M in (bash) shell buffer
Date: 23 Sep 1996 11:07:21 -0400

preilly@ROKCHR.shr.dec.com writes:

> I leaped from 19.31 to 19.34 and started to get gratuitous ^M's in my
> shell buffer (and some others, but I assume the cure will fix all of
> them).  And I seem to remember a message addressing this problem but
> cannot find it.
> 
> What is the cure?

This depends on where you got your binaries.  If you ftp'd the
binaries that Voelker supplies, than the problem is more widespread
that I thought, and I don't know an answer.  If, however, you compiled
the binaries from the source yourself, were you using MVC++ 4.2?  If
so, the first fix to use is to compile with MVC++ 4.1 instead (some
default somewhere was changed behind our backs).  If this is difficult
to do, the following change fixes the problem for me in 4.2, as long
as there are no gratuitous ^Zs output by your shell.  (This change is
not necessarily endorsed by the ntemacs maintainers.)

Change the following line in nt.c

  rc = _pipe (phandles, 0, _O_NOINHERIT);

to

  rc = _pipe (phandles, 0, _O_TEXT | _O_NOINHERIT);

-- 
Michael Duggan
(md5i@schenley.com)

From rcourt@best.com  Mon Sep  9 23:02:34 1996
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	[nil "Mon" " 9" "September" "1996" "22:58:34" "-0700" "Ron Courtright" "rcourt@best.com" "<199609100602.XAA21865@dns1.noc.best.net>" "22" "comint-process-echoes appears broken in 19.34.1" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from dns1.noc.best.net (dns1.noc.best.net [206.86.8.69]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id XAA22704 for <voelker@cs.washington.edu>; Mon, 9 Sep 1996 23:02:33 -0700
Received: from locutus (rcourt.vip.best.com [206.86.223.116]) by dns1.noc.best.net (8.6.12/8.6.5) with ESMTP id XAA21865 for <voelker@cs.washington.edu>; Mon, 9 Sep 1996 23:02:30 -0700
Message-Id: <199609100602.XAA21865@dns1.noc.best.net>
Reply-To: <rcourt@best.com>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1141
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
From: "Ron Courtright" <rcourt@best.com>
To: <voelker@cs.washington.edu>
Subject: comint-process-echoes appears broken in 19.34.1
Date: Mon, 9 Sep 1996 22:58:34 -0700

Greetings,

First, thank you for your efforts in making emacs available.  I am using
v19.34.1 on NT 4b2 and it appears that setting comint-process-echoes to t
no longer stops the echo of the command when in shell mode.  BTW, the
command is echoed to the next line.  If set to nil, then the command is
echoed on the same line.

If this is a case of user error, please advise.

Again, thank you.

Be seeing you,

Ron

-------------------------------------------------------------------------
Ron Courtright                                            rcourt@best.com

PGP Key ID:                                                      4DF26355
PGP Key Fingerprint:     49 E4 D4 34 B1 4E 51 D1  94 65 CD 10 B2 A6 A4 52
-------------------------------------------------------------------------

From owner-ntemacs-users@june  Tue Sep 10 11:31:45 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "10" "September" "1996" "10:43:45" "-0700" "Mark D. Grosen" "mdgrosen@spectron.com" nil "15" "Solution: comint-completion-addsuffix" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id LAA24872 for <voelker@june.cs.washington.edu>; Tue, 10 Sep 1996 11:31:45 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id LAA15532 for <voelker@joker.cs.washington.edu>; Tue, 10 Sep 1996 11:31:41 -0700
Received: from nic.cerf.net (nic.cerf.net [192.102.249.3]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id KAA16661 for <ntemacs-users@cs.washington.edu>; Tue, 10 Sep 1996 10:43:59 -0700
Received: from spectron.COM ([146.152.131.1]) by nic.cerf.net (8.7.5/8.6.9) with SMTP id KAA11435 for <ntemacs-users@cs.washington.edu>; Tue, 10 Sep 1996 10:43:57 -0700 (PDT)
Received: from tsmbeta.spectron.com by spectron.COM (4.1/SMI-4.1) 	id AA23160; Tue, 10 Sep 96 10:43:36 PDT
Message-Id: <2.2.32.19960910174345.0086f4d0@spox>
X-Sender: mg@spox
X-Mailer: Windows Eudora Pro Version 2.2 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: "Mark D. Grosen" <mdgrosen@spectron.COM>
To: ntemacs-users@cs.washington.edu
Subject: Solution: comint-completion-addsuffix
Date: Tue, 10 Sep 1996 10:43:45 -0700

Well, I failed in my reading of the manual and missed the obvious solution
to my problem with shell-mode-hook. The answer is below:

Mark_McIntosh@pml.com:
     The Emacs add-hook function accepts an optional third argument, which 
     if non-nil will force the hook to be appended to the hook list.

Hence, the following does the trick:

    (add-hook 'shell-mode-hook
	      '(lambda () (setq comint-completion-addsuffix t)) t)

Thanks for all the help (and refraining from mere RTFM's :)

Mark

From owner-ntemacs-users@june  Tue Sep 10 15:18:52 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "10" "September" "1996" "14:21:24" "-0700" "Eric Hanchrow" "erich@microsoft.com" nil "38" "RE: how to not echo shell command in NT v19.34.1" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id PAA24448 for <voelker@june.cs.washington.edu>; Tue, 10 Sep 1996 15:18:51 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA15598 for <voelker@joker.cs.washington.edu>; Tue, 10 Sep 1996 15:18:48 -0700
Received: from mail3.microsoft.com (mail3.microsoft.com [131.107.3.23]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA17741 for <ntemacs-users@cs.washington.edu>; Tue, 10 Sep 1996 14:22:10 -0700
Received: by mail3.microsoft.com with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.993.5) 	id <01BB9F23.4FBBF390@mail3.microsoft.com>; Tue, 10 Sep 1996 14:21:09 -0700
Message-ID: <c=US%a=_%p=msft%l=RED-74-MSG-960910212124Z-26471@mail3.microsoft.com>
X-Mailer:  Microsoft Exchange Server Internet Mail Connector Version 4.0.993.5
Encoding: 38 TEXT
From: Eric Hanchrow <erich@MICROSOFT.com>
To: "'Ronald Courtright'" <rcourt@best.com>,         NT GNU Emacs Users 	 <ntemacs@MICROSOFT.com>,         "'ntemacs-users@cs.washington.edu'" 	 <ntemacs-users@cs.washington.edu>
Subject: RE: how to not echo shell command in NT v19.34.1
Date: Tue, 10 Sep 1996 14:21:24 -0700

I've found that putting

      ;; To prevent all command lines from getting echoed.
      (add-hook 'shell-mode-hook '(lambda () (setq explicit-cmd.exe-args
'("/q"))))

in my .emacs keeps my commands from echoing.

Also, if you want to get rid of those control-Ms:

      ;; To prevent unsightly control-Ms from showing up in the shell
buffer.
      (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)


>-----Original Message-----
From:	Ronald Courtright [SMTP:rcourt@best.com]
Sent:	Tuesday, September 10, 1996 12:48 PM
To:	ntemacs-users@cs.washington.edu
Subject:	how to not echo shell command in NT v19.34.1

Greetings,

I did not have this problem in v19.31, but in shell mode, the cmd is
echoed
on a newline.  So, if I enter 
$ ls
ls
foo bar
Same problem if I use an NT native cmd like 'dir.'

I tried 'setq comint-process-noecho t' but to no avail.

I am open to suggestions.  Oh, yes, I am using NT v4b2.

Regards,

Ron

From owner-ntemacs-users@june  Tue Sep 10 15:32:04 1996
X-VM-v5-Data: ([nil nil nil nil nil nil t nil nil]
	[nil "Tue" "10" "September" "1996" "17:44:54" "-0400" "David Biesack" "sasdjb@unx.sas.com" nil "11" "ntemacs: cmd echos in shell buffers" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id PAA26176 for <voelker@june.cs.washington.edu>; Tue, 10 Sep 1996 15:32:04 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA19188 for <voelker@joker.cs.washington.edu>; Tue, 10 Sep 1996 15:32:00 -0700
Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA20577 for <ntemacs-users@cs.washington.edu>; Tue, 10 Sep 1996 14:45:10 -0700
Received: from mozart by lamb.sas.com (5.65c/SAS/Gateway/01-23-95) 	id AA14596; Tue, 10 Sep 1996 17:45:09 -0400
Received: from lambda.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) 	id AA29688; Tue, 10 Sep 1996 17:44:55 -0400
Received: by lambda.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93) 	id AA06453; Tue, 10 Sep 1996 17:44:54 -0400
Message-Id: <199609102144.AA06453@lambda.unx.sas.com>
From: David Biesack <sasdjb@unx.sas.com>
To: ntemacs-users@cs.washington.edu
Subject: ntemacs: cmd echos in shell buffers
Date: Tue, 10 Sep 1996 17:44:54 -0400


Someone recently asked about the commands they type in shell buffers
being echoed. This is being done by cmd.exe, not comint.  
Set explicit-cmd-args to "/q" to suppress this echoing.  

Do cmd /? for more info.

-- 
David J. Biesack                                    sasdjb@unx.sas.com
Object Programming Technology                  (919) 677-8000 ext 7771
SAS Institute Inc. SAS Campus Drive Cary, NC 27513  http://www.sas.com

From rms@gnu.ai.mit.edu  Wed Sep 11 00:50:34 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "11" "September" "1996" "03:50:29" "-0400" "Richard Stallman" "rms@gnu.ai.mit.edu" nil "26" "[erich@MICROSOFT.com: Some useful defaults for shell mode on Windows NT]" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from ethanol.gnu.ai.mit.edu (ethanol.gnu.ai.mit.edu [128.52.46.64]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id AAA08849 for <voelker@cs.washington.edu>; Wed, 11 Sep 1996 00:50:33 -0700
Received: by ethanol.gnu.ai.mit.edu (8.6.12/8.6.12GNU) id DAA20374; Wed, 11 Sep 1996 03:50:29 -0400
Message-Id: <199609110750.DAA20374@ethanol.gnu.ai.mit.edu>
From: Richard Stallman <rms@gnu.ai.mit.edu>
To: voelker@cs.washington.edu, andrewi@harlequin.co.uk
Subject: [erich@MICROSOFT.com: Some useful defaults for shell mode on Windows NT]
Date: Wed, 11 Sep 1996 03:50:29 -0400

If you think something like this should be installed somewhere,
could you please send me a patch to do it in a clean way?

------- Start of forwarded message -------
From: Eric Hanchrow <erich@MICROSOFT.com>
To: "'bug-gnu-emacs@prep.ai.mit.edu'" <bug-gnu-emacs@prep.ai.mit.edu>
Subject: Some useful defaults for shell mode on Windows NT
Date: Tue, 10 Sep 1996 16:10:18 -0700
X-Mailer:  Microsoft Exchange Server Internet Mail Connector Version 4.0.993.5
Encoding: 15 TEXT

In GNU Emacs 19.33.1 (i386-*-nt4.0) of Wed Aug 14 1996 on ERICH4
configured using `configure NT'

I've found that the following code in my .emacs makes shell mode on
Windows NT more pleasant; I suspect almost all other NT Emacs users
would feel the same way, so I propose that these variables have these
values by default on NT:

      ;; To prevent all command lines from getting echoed.
      (add-hook 'shell-mode-hook '(lambda () (setq explicit-cmd.exe-args
'("/q"))))

	;; To prevent unsightly control-Ms from showing up in the shell buffer.
      (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
------- End of forwarded message -------

From owner-ntemacs-users@june  Wed Sep 11 08:53:38 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "11" "September" "1996" "10:57:47" "-0400" "David Biesack" "sasdjb@unx.sas.com" nil "15" "> killing shell buffer" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id IAA13965 for <voelker@june.cs.washington.edu>; Wed, 11 Sep 1996 08:53:37 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id IAA25116 for <voelker@joker.cs.washington.edu>; Wed, 11 Sep 1996 08:53:34 -0700
Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id HAA08349 for <ntemacs-users@cs.washington.edu>; Wed, 11 Sep 1996 07:58:33 -0700
Received: from mozart by lamb.sas.com (5.65c/SAS/Gateway/01-23-95) 	id AA19713; Wed, 11 Sep 1996 10:58:31 -0400
Received: from lambda.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) 	id AA26928; Wed, 11 Sep 1996 10:57:48 -0400
Received: by lambda.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93) 	id AA07711; Wed, 11 Sep 1996 10:57:47 -0400
Message-Id: <199609111457.AA07711@lambda.unx.sas.com>
In-Reply-To: <9609111306.AA22278@ss5mth01.franklin.com> (mike@franklin.com)
From: David Biesack <sasdjb@unx.sas.com>
To: ntemacs-users@cs.washington.edu
Subject: > killing shell buffer
Date: Wed, 11 Sep 1996 10:57:47 -0400

> Date: Wed, 11 Sep 96 09:06:41 EDT
> From: mike@franklin.com (Mike Woolf)
> 
> Running emacs-19.34 in Windows 95, "M-x shell" starts up a DOS shell buffer.
> Two questions:
> 
>         1.  Is there a way to run some sort of "autoexec.bat" so that certain
> things (like the prompt) can be set up in advance?

Set explicit-cmd.exe-args to '("/q" "/kc:\\startup.cmd")

-- 
David J. Biesack                                    sasdjb@unx.sas.com
Object Programming Technology                  (919) 677-8000 ext 7771
SAS Institute Inc. SAS Campus Drive Cary, NC 27513  http://www.sas.com

From owner-ntemacs-users@june  Wed Sep 11 13:54:59 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "11" "September" "1996" "12:12:33" "-0700" "Eric Hanchrow" "erich@microsoft.com" nil "45" "RE: how to not echo shell command in NT v19.34.1" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA17858 for <voelker@june.cs.washington.edu>; Wed, 11 Sep 1996 13:54:59 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA19082 for <voelker@joker.cs.washington.edu>; Wed, 11 Sep 1996 13:54:55 -0700
Received: from mail.microsoft.com (mail1.microsoft.com [131.107.3.41]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA12131 for <ntemacs-users@cs.washington.edu>; Wed, 11 Sep 1996 13:07:02 -0700
Received: by mail.microsoft.com with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.994.24) 	id <01BB9FDA.BCFE7420@mail.microsoft.com>; Wed, 11 Sep 1996 12:14:10 -0700
Message-ID: <c=US%a=_%p=msft%l=RED-74-MSG-960911191233Z-29658@mail.microsoft.com>
X-Mailer:  Microsoft Exchange Server Internet Mail Connector Version 4.0.994.24
Encoding: 45 TEXT
From: Eric Hanchrow <erich@MICROSOFT.com>
To: NT GNU Emacs Users <ntemacs@MICROSOFT.com>,         "'ntemacs-users@cs.washington.edu'" 	 <ntemacs-users@cs.washington.edu>
Subject: RE: how to not echo shell command in NT v19.34.1
Date: Wed, 11 Sep 1996 12:12:33 -0700

For some reason, my fix (below) for suppressing echoes in the shell
buffer only works the *second* time I do M-x shell in an Emacs session.

>-----Original Message-----
>From:	Eric Hanchrow 
>Sent:	Tuesday, September 10, 1996 02:21 PM
>To:	'Ronald Courtright'; NT GNU Emacs Users; ntemacs-users@cs.washington.edu
>Subject:	RE: how to not echo shell command in NT v19.34.1
>
>I've found that putting
>
>      ;; To prevent all command lines from getting echoed.
>      (add-hook 'shell-mode-hook '(lambda () (setq explicit-cmd.exe-args
>'("/q"))))
>
>in my .emacs keeps my commands from echoing.
>
>Also, if you want to get rid of those control-Ms:
>
>      ;; To prevent unsightly control-Ms from showing up in the shell buffer.
>      (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
>
>
>-----Original Message-----
>From:	Ronald Courtright [SMTP:rcourt@best.com]
>Sent:	Tuesday, September 10, 1996 12:48 PM
>To:	ntemacs-users@cs.washington.edu
>Subject:	how to not echo shell command in NT v19.34.1
>
>Greetings,
>
>I did not have this problem in v19.31, but in shell mode, the cmd is echoed
>on a newline.  So, if I enter 
>$ ls
>ls
>foo bar
>Same problem if I use an NT native cmd like 'dir.'
>
>I tried 'setq comint-process-noecho t' but to no avail.
>
>I am open to suggestions.  Oh, yes, I am using NT v4b2.
>
>Regards,
>
>Ron

From owner-ntemacs-users@june  Wed Sep 11 15:28:22 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "11" "September" "1996" "17:36:04" "-0400" "Peter Breton" "pbreton@volte.i-kinetics.com" nil "41" "RE: how to not echo shell command in NT v19.34.1" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id PAA27701 for <voelker@june.cs.washington.edu>; Wed, 11 Sep 1996 15:28:22 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA21329 for <voelker@joker.cs.washington.edu>; Wed, 11 Sep 1996 15:28:18 -0700
Received: from ns.i-kinetics.com (ns.i-kinetics.com [198.69.254.24]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA22765 for <ntemacs-users@cs.washington.edu>; Wed, 11 Sep 1996 14:38:14 -0700
Received: (Unknown UID 8@localhost) by ns.i-kinetics.com (8.6.11/8.6.5) id RAA29969; Wed, 11 Sep 1996 17:38:05 -0400
Received: from dirac.i-kinetics.com(192.31.81.157) by ns.i-kinetics.com via smap (V1.3) 	id sma029966; Wed Sep 11 17:37:45 1996
Received: from volte.i-kinetics.com by i-kinetics.com (4.1/SMI-4.1/UUNET) 	id AA13804; Wed, 11 Sep 96 17:37:02 EDT
Received: by volte.i-kinetics.com (SMI-8.6/SMI-SVR4) 	id RAA21461; Wed, 11 Sep 1996 17:36:04 -0400
Message-Id: <199609112136.RAA21461@volte.i-kinetics.com>
In-Reply-To: <c=US%a=_%p=msft%l=RED-74-MSG-960911191233Z-29658@mail.microsoft.com>
References: <c=US%a=_%p=msft%l=RED-74-MSG-960911191233Z-29658@mail.microsoft.com>
Reply-To: pbreton@i-kinetics.com
From: Peter Breton <pbreton@volte.i-kinetics.com>
To: Eric Hanchrow <erich@MICROSOFT.com>
Cc: NT GNU Emacs Users <ntemacs@MICROSOFT.com>,         "'ntemacs-users@cs.washington.edu'" 	 <ntemacs-users@cs.washington.edu>
Subject: RE: how to not echo shell command in NT v19.34.1
Date: Wed, 11 Sep 1996 17:36:04 -0400


 Eric> For some reason, my fix (below) for suppressing echoes in the
 Eric> shell buffer only works the *second* time I do M-x shell in an
 Eric> Emacs session.

Quite likely your setq is taking effect _after_ explicit-cmd.exe-args
has been consulted! 

This works well for me:

(defvar cmd-init-file (concat my-home "\\cmdinit.cmd"))
(defvar explicit-cmd-args
      (list "/q" (concat "/k" cmd-init-file)))

;; NT-Shell
(defun nt-shell ()
  "Runs the Windows NT native shell"
  (interactive)
  (let ((explicit-shell-file-name "cmd"))
    (shell) 
    (make-local-variable 'explicit-shell-file-name)
    (setq explicit-shell-file-name "cmd")))

It also lets you run multiple shells, if desired; just define similar
bash and tcsh (and whatever) functions.

			Peter

 >> -----Original Message----- From: Eric Hanchrow Sent: Tuesday,
 >> September 10, 1996 02:21 PM To: 'Ronald Courtright'; NT GNU Emacs
 >> Users; ntemacs-users@cs.washington.edu Subject: RE: how to not
 >> echo shell command in NT v19.34.1
 >> 
 >> I've found that putting
 >> 
 >> ;; To prevent all command lines from getting echoed.  (add-hook
 >> 'shell-mode-hook '(lambda () (setq explicit-cmd.exe-args
 >> '("/q"))))
 >> 
 >> in my .emacs keeps my commands from echoing.
 >> 

From owner-ntemacs-users@june  Mon Sep 30 10:57:14 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "30" "September" "1996" "11:23:51" "CDT" "George D. Hadden" "hadden@htc.honeywell.com" nil "105" "yet another fix for double echo in shell" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id KAA20161 for <voelker@june.cs.washington.edu>; Mon, 30 Sep 1996 10:57:13 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA17941 for <voelker@joker.cs.washington.edu>; Mon, 30 Sep 1996 10:57:11 -0700
Received: from moon.htc.honeywell.com (moon.htc.honeywell.com [129.235.16.32]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id JAA10119 for <ntemacs-users@cs.washington.edu>; Mon, 30 Sep 1996 09:23:54 -0700
Received: from nirvana.htc.honeywell.com by moon.htc.honeywell.com (4.1/smail2.6.3/SRCv0.25); 	Mon, 30 Sep 96 11:23:52 CDT id AA16801  for ntemacs-users@cs.washington.edu  at cs.washington.edu
Posted-Date: Mon, 30 Sep 96 11:23:51 CDT
Received: by nirvana.htc.honeywell.com (4.1/SMI-3.2) 	id AA25853; Mon, 30 Sep 96 11:23:51 CDT
Message-Id: <9609301623.AA25853@nirvana.htc.honeywell.com>
From: hadden@htc.honeywell.com (George D. Hadden)
To: ntemacs-users@cs.washington.edu
Subject: yet another fix for double echo in shell
Date: Mon, 30 Sep 96 11:23:51 CDT

i'm having a problem with processes echoing input that doesn't seem to
be fixed by setting comint-process-echoes to t.  i think there's a bug
in comint.el AND i have a suggested fix for it.  (can someone tell me
the appropriate protocol to submit this bug report and fix?  thanks.)
although, i DO wonder why this hasn't been reported on the newsgroup
... maybe something else i did broke it ... :-}

here's the problem.  note the unwanted echoing occurs either on the
same line as the input or the following line depending on whether
comint-process-echoes is t or nil.

	  Microsoft(R) Windows 95
	     (C)Copyright Microsoft Corp 1981-1995.

	  rem comint-process-echoes --> t
	  rem comint-input-autoexpand --> history

	  uh, clem?  C:\TEMP>dirdir

	   Volume in drive C is MS-DOS_62  
	   Volume Serial Number is 1CFD-182F
	   Directory of C:\TEMP

	  .              <DIR>        07-10-95  1:51p .
	  ..             <DIR>        07-10-95  1:51p ..
	  T                        0  09-30-96 10:58a t
		   1 file(s)              0 bytes
		   2 dir(s)      46,891,008 bytes free

	  rem comint-process-echoes --> nil

	  uh, clem?  C:\TEMP>dir
	  dir

	   Volume in drive C is MS-DOS_62  
	   Volume Serial Number is 1CFD-182F
	   Directory of C:\TEMP

	  .              <DIR>        07-10-95  1:51p .
	  ..             <DIR>        07-10-95  1:51p ..
	  T                        0  09-30-96 10:58a t
		   1 file(s)              0 bytes
		   2 dir(s)      46,891,008 bytes free

	  uh, clem?  C:\TEMP>

the reason for the problem and it's fix should be clear from my
comments in the function comint-send-input (from the file comint.el)
shown below: 

(defun comint-send-input () 
... stuff deleted ...
	       (history (if (not (eq comint-input-autoexpand 'history))
			    input
			  ;; This is messy 'cos ultimately the original
			  ;; functions used do insertion, rather than return
			  ;; strings.  We have to expand, then insert back.
			  (comint-replace-by-expanded-history t)
			  (let ((copy (buffer-substring pmark (point))))
			    ;; geo:  the following has the unfortunate
			    ;; consequence of eliminating the difference
			    ;; between pmark and point.  this causes a double
			    ;; same-line echo of the command because of the
			    ;; now ineffective delete-region below.
			    ;;
			    ;; changing insert-before-markers to insert
			    ;; seems to fix the problem by allowing pmark
			    ;; to remain before the input and thus allowing
			    ;; the subsequent delete-region to work correctly
			    ;;
			    (delete-region pmark (point))
;			    (insert-before-markers input)
			    (insert input)
			    copy))))
          (if comint-process-echoes
              (delete-region pmark (point))
	    (insert-before-markers ?\n))
... stuff deleted ...

here's the same shell command after evaluating the function with the
above changes:

	  uh, clem?  C:\TEMP>dir

	   Volume in drive C is MS-DOS_62  
	   Volume Serial Number is 1CFD-182F
	   Directory of C:\TEMP

	  .              <DIR>        07-10-95  1:51p .
	  ..             <DIR>        07-10-95  1:51p ..
	  T                        0  09-30-96 10:58a t
		   1 file(s)              0 bytes
		   2 dir(s)      46,858,240 bytes free

	  uh, clem?  C:\TEMP>

(no, i didn't fix the ^M problem - sorry :-)

comments?

-geo
---
George D. Hadden, Senior Research Fellow
Honeywell Technology Center, 3660 Technology Drive, Minneapolis, MN 55418
hadden@src.honeywell.com, (612)951-7769(voice), (612)951-7438(fax)


> Date: Mon, 30 Sep 96 11:23:51 CDT
> From: hadden@htc.honeywell.com (George D. Hadden)
> 
> i'm having a problem with processes echoing input that doesn't seem to
> be fixed by setting comint-process-echoes to t.

The correct fix is to start cmd.exe with the /q option via 

  (setq explicit-cmd.exe-args "/q")

where explicit-shell-file-name is "cmd.exe". If you use a different
explicit-shell-file-name, set the explicit-*-args variable accordingly.

That is, cmd.exe is echoing the commands, not comint
From owner-ntemacs-users@june  Mon Sep 30 13:52:03 1996
X-VM-v5-Data: ([nil nil nil nil nil t nil nil nil]
	[nil "Mon" "30" "September" "1996" "15:59:24" "-0400" "David Biesack" "sasdjb@unx.sas.com" nil "15" "> yet another fix for double echo in shell" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id NAA08915 for <voelker@june.cs.washington.edu>; Mon, 30 Sep 1996 13:52:02 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA27536 for <voelker@joker.cs.washington.edu>; Mon, 30 Sep 1996 13:52:01 -0700
Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id MAA04316 for <ntemacs-users@cs.washington.edu>; Mon, 30 Sep 1996 12:59:37 -0700
Received: from mozart by lamb.sas.com (5.65c/SAS/Gateway/01-23-95) 	id AA12271; Mon, 30 Sep 1996 15:59:30 -0400
Received: from lambda.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) 	id AA21464; Mon, 30 Sep 1996 15:59:24 -0400
Received: by lambda.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93) 	id AA08792; Mon, 30 Sep 1996 15:59:24 -0400
Message-Id: <199609301959.AA08792@lambda.unx.sas.com>
In-Reply-To: <9609301623.AA25853@nirvana.htc.honeywell.com> 	(hadden@htc.honeywell.com)
From: David Biesack <sasdjb@unx.sas.com>
To: hadden@htc.honeywell.com, ntemacs-users@cs.washington.edu
Subject: > yet another fix for double echo in shell
Date: Mon, 30 Sep 1996 15:59:24 -0400


> Date: Mon, 30 Sep 96 11:23:51 CDT
> From: hadden@htc.honeywell.com (George D. Hadden)
> 
> i'm having a problem with processes echoing input that doesn't seem to
> be fixed by setting comint-process-echoes to t.

The correct fix is to start cmd.exe with the /q option via 

  (setq explicit-cmd.exe-args "/q")

where explicit-shell-file-name is "cmd.exe". If you use a different
explicit-shell-file-name, set the explicit-*-args variable accordingly.

That is, cmd.exe is echoing the commands, not comint

From owner-ntemacs-users@june  Mon Sep 30 16:50:15 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "30" "September" "1996" "18:20:13" "-0500" "Milt Epstein" "epstein@cd.com" nil "41" "Re: shell-command and shell-command-on-region" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id QAA25992 for <voelker@june.cs.washington.edu>; Mon, 30 Sep 1996 16:50:15 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id QAA27379 for <voelker@joker.cs.washington.edu>; Mon, 30 Sep 1996 16:50:13 -0700
Received: from beltway (beltway.cd.com [204.217.30.66]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id QAA22273 for <ntemacs-users@cs.washington.edu>; Mon, 30 Sep 1996 16:08:45 -0700
Received: from bif.cd.com by beltway (5.x/SMI-SVR4) 	id AA03363; Mon, 30 Sep 1996 18:07:54 -0500
Received: from localhost by bif.cd.com (4.1/SMI-4.1) 	id AA27385; Mon, 30 Sep 96 18:20:13 CDT
In-Reply-To: <s7qwwxcdlfo.fsf@concentra.com>
Message-Id: <Pine.SUN.3.94.960930180351.27046A-100000@bif>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
From: Milt Epstein <epstein@cd.com>
Sender: epstein@cd.com
To: ntemacs-users@cs.washington.edu
Subject: Re: shell-command and shell-command-on-region
Date: Mon, 30 Sep 1996 18:20:13 -0500 (CDT)

On 30 Sep 1996, Brent Benson wrote:

> Chris Kolb <chris@vautomation.com> writes:
> > 
> > Good Morning,  I've been running emacs for years on Unix systems, and am
> > just switching to PC's, and I'm having problems with the shell-command and
> > shell-command-on-region.  Shell-mode operates as expected, and invokes my
> > prefered shell (currently MKS's Korn shell).  The shell-command and
> > shell-command on region return the following message: "/c: /c: not found".
> 
> You should use:
> 
>   (setq shell-command-switch "-c")
> 
> in your .emacs file.

I ran into this same problem (except I'm using tcsh), and this is the
same solution I came up with.  It took a little bit of poking around
to find out what was going on.  The problem is that the following line
appears in winnt.el (which is automatically loaded from loadup.el,
which I believe means it's effectively compiled in to the dumped
emacs):

   (setq shell-command-switch "/c")

This effectively makes the assumption that everyone using ntemacs is
using cmd.exe as their shell (or some command interpreter that uses
"/" style switches as opposed to "-" style ones) -- this assumption is
too strong, since lots of people are using UNIX-type shells like bash,
ksh, and tcsh.  Wouldn't it be better if instead of hard-coding this
setting, it was placed inside a conditional and/or a hook, so that it
could check which shell was being used before setting it?  (I'm not
sure what the conditional should check for or whether an appropriate
hook exists, although there appears to be a shell-mode-hook.)

Milt Epstein
Software Engineer
Central Data Corporation
epstein@cd.com
WWW: http://www.cd.com/
FTP: ftp.cd.com

From owner-ntemacs-users@june  Mon Sep 30 16:58:48 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "30" "September" "1996" "18:03:48" "CDT" "George D. Hadden" "hadden@htc.honeywell.com" nil "50" "Re: > yet another fix for double echo in shell" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id QAA26870 for <voelker@june.cs.washington.edu>; Mon, 30 Sep 1996 16:58:47 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id QAA16630 for <voelker@joker.cs.washington.edu>; Mon, 30 Sep 1996 16:58:45 -0700
Received: from moon.htc.honeywell.com (moon.htc.honeywell.com [129.235.16.32]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id QAA21855 for <ntemacs-users@cs.washington.edu>; Mon, 30 Sep 1996 16:03:51 -0700
Received: from nirvana.htc.honeywell.com by moon.htc.honeywell.com (4.1/smail2.6.3/SRCv0.25); 	Mon, 30 Sep 96 18:03:50 CDT id AA24224  for ntemacs-users@cs.washington.edu  at cs.washington.edu
Posted-Date: Mon, 30 Sep 96 18:03:48 CDT
Received: by nirvana.htc.honeywell.com (4.1/SMI-3.2) 	id AA27059; Mon, 30 Sep 96 18:03:48 CDT
Message-Id: <9609302303.AA27059@nirvana.htc.honeywell.com>
In-Reply-To: <199609301959.AA08792@lambda.unx.sas.com> (message from David Biesack on Mon, 30 Sep 1996 15:59:24 -0400)
From: hadden@htc.honeywell.com (George D. Hadden)
To: sasdjb@unx.sas.com
Cc: ntemacs-users@cs.washington.edu
Subject: Re: > yet another fix for double echo in shell
Date: Mon, 30 Sep 96 18:03:48 CDT

>>>>> "DB" == David Biesack <sasdjb@unx.sas.com> writes:

>> Date: Mon, 30 Sep 96 11:23:51 CDT
>> From: hadden@htc.honeywell.com (George D. Hadden)
>> 
>> i'm having a problem with processes echoing input that doesn't seem to
>> be fixed by setting comint-process-echoes to t.

DB> The correct fix is to start cmd.exe with the /q option via 

DB>   (setq explicit-cmd.exe-args "/q")

DB> where explicit-shell-file-name is "cmd.exe". If you use a different
DB> explicit-shell-file-name, set the explicit-*-args variable accordingly.

DB> That is, cmd.exe is echoing the commands, not comint

david, thanks for your response.  unfortunately, i tried this and it
doesn't work for me.  i think that there's a bug in the elisp
code, and i'm looking for verification of this and comments on the solution
proposed in my previous message.

again, here are the conditions that make this bug appear:
1) windows 95 (although this shouldn't matter)
2) comint-input-autoexpand --> 'history
3) comint-process-echoes --> t

incidentally, since they're buffer-local symbols, performing the 

(setq comint-input-autexpand 'history) 

and the 

(setq comint-process-echoes t) 

in the *scratch* buffer will not do what you want.  you must instead
execute the command "eval-expression", and then type the expressions to it
while in the *shell* buffer.  (there's probably a better way, but i don't
know it :-)

so, is there anyone out there for whom this also fails, or am i
halucinating? 

thanks,

-geo
---
George D. Hadden, Senior Research Fellow
Honeywell Technology Center, 3660 Technology Drive, Minneapolis, MN 55418
hadden@src.honeywell.com, (612)951-7769(voice), (612)951-7438(fax)

From owner-ntemacs-users@june  Tue Oct  1 09:25:32 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 1" "October" "1996" "10:51:32" "-0400" "Dave Strauss" "dstrauss@systemsoft.com" nil "50" "Re: > yet another fix for double echo in shell" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id JAA26026 for <voelker@june.cs.washington.edu>; Tue, 1 Oct 1996 09:25:32 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id JAA26943 for <voelker@joker.cs.washington.edu>; Tue, 1 Oct 1996 09:25:31 -0700
Received: from ssftsun.systemsoft.com (ssftsun.leftbank.com [199.94.246.68]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id HAA18725 for <ntemacs-users@cs.washington.edu>; Tue, 1 Oct 1996 07:50:52 -0700
Received: from dstrauss ([199.94.246.187]) by ssftsun.systemsoft.com (8.7.5/8.7.3/LeftBank-SystemSoft-1.0) with SMTP id KAA00049; Tue, 1 Oct 1996 10:45:32 -0400 (EDT)
Message-Id: <2.2.32.19961001145132.0092b7fc@ssftsun.systemsoft.com>
X-Sender: dstrauss@ssftsun.systemsoft.com
X-Mailer: Windows Eudora Pro Version 2.2 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Dave Strauss <dstrauss@systemsoft.com>
To: hadden@htc.honeywell.com (George D. Hadden)
Cc: ntemacs-users@cs.washington.edu
Subject: Re: > yet another fix for double echo in shell
Date: Tue, 01 Oct 1996 10:51:32 -0400

At 06:03 PM 9/30/96 CDT, George D. Hadden wrote:
 +----
 | >>>>> "DB" == David Biesack <sasdjb@unx.sas.com> writes:
 | 
 | >> Date: Mon, 30 Sep 96 11:23:51 CDT
 | >> From: hadden@htc.honeywell.com (George D. Hadden)
 | >> 
 | >> i'm having a problem with processes echoing input that doesn't seem to
 | >> be fixed by setting comint-process-echoes to t.
 | 
 | DB> The correct fix is to start cmd.exe with the /q option via 
 | 
 | DB>   (setq explicit-cmd.exe-args "/q")
 | 
 | DB> where explicit-shell-file-name is "cmd.exe". If you use a different
 | DB> explicit-shell-file-name, set the explicit-*-args variable accordingly.
 | 
 | DB> That is, cmd.exe is echoing the commands, not comint
 | 
 | david, thanks for your response.  unfortunately, i tried this and it
 | doesn't work for me.  i think that there's a bug in the elisp
 | code, and i'm looking for verification of this and comments on the solution
 | proposed in my previous message.
 | 
 | again, here are the conditions that make this bug appear:
 | 1) windows 95 (although this shouldn't matter)

Actually, this DOES matter because Win95 uses command.com, not cmd.exe,
as the command shell.  The arguments to command.com are different than
for cmd.exe.  I have this working on my Win95 machine at home, but
I've forgotten how it's set up :-(.  For Windows NT, I have
   (setq explicit-cmd.exe-args '("/q") )
in my .emacs file.  I seem to recall that for Win95 I have
   (setq explicit-command.com-args nil)
but I'll have to check that.


 | [ ... ]
 | 
 +----

-------------------------------------------------------------------------------
"The best ideas do not | Dave Strauss@work   dstrauss@systemsoft.com  
 necessarily come from |                     http://www.systemsoft.com
 the loudest voices"   |                     Phone: 508-647-2873
                       |                     Fax:   508-651-8188
                       |
                       | Dave Strauss@play   dstrauss@gis.net
                       |                     http://www.gis.net/~dstrauss
-------------------------------------------------------------------------------

From owner-ntemacs-users@june  Tue Oct  1 11:06:16 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 1" "October" "1996" "11:32:02" "CDT" "George D. Hadden" "hadden@htc.honeywell.com" nil "73" "Re: > yet another fix for double echo in shell" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id LAA10655 for <voelker@june.cs.washington.edu>; Tue, 1 Oct 1996 11:06:16 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id LAA27491 for <voelker@joker.cs.washington.edu>; Tue, 1 Oct 1996 11:06:15 -0700
Received: from moon.htc.honeywell.com (moon.htc.honeywell.com [129.235.16.32]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id JAA26563 for <ntemacs-users@cs.washington.edu>; Tue, 1 Oct 1996 09:32:05 -0700
Received: from nirvana.htc.honeywell.com by moon.htc.honeywell.com (4.1/smail2.6.3/SRCv0.25); 	Tue, 1 Oct 96 11:32:03 CDT id AA08366  for ntemacs-users@cs.washington.edu  at cs.washington.edu
Posted-Date: Tue, 1 Oct 96 11:32:02 CDT
Received: by nirvana.htc.honeywell.com (4.1/SMI-3.2) 	id AA01594; Tue, 1 Oct 96 11:32:02 CDT
Message-Id: <9610011632.AA01594@nirvana.htc.honeywell.com>
In-Reply-To: <2.2.32.19961001145132.0092b7fc@ssftsun.systemsoft.com> (message from Dave Strauss on Tue, 01 Oct 1996 10:51:32 -0400)
From: hadden@htc.honeywell.com (George D. Hadden)
To: dstrauss@systemsoft.com
Cc: ntemacs-users@cs.washington.edu
Subject: Re: > yet another fix for double echo in shell
Date: Tue, 1 Oct 96 11:32:02 CDT

ok, one more time!!!

my note and david's response:

    >>>>> "DB" == David Biesack <sasdjb@unx.sas.com> writes:

    >> Date: Mon, 30 Sep 96 11:23:51 CDT
    >> From: hadden@htc.honeywell.com (George D. Hadden)
    >> 
    >> i'm having a problem with processes echoing input that doesn't seem to
    >> be fixed by setting comint-process-echoes to t.

    DB> The correct fix is to start cmd.exe with the /q option via 

    DB>   (setq explicit-cmd.exe-args "/q")

    DB> where explicit-shell-file-name is "cmd.exe". If you use a different
    DB> explicit-shell-file-name, set the explicit-*-args variable accordingly.

    DB> That is, cmd.exe is echoing the commands, not comint

    david, thanks for your response.  unfortunately, i tried this and it
    doesn't work for me.  i think that there's a bug in the elisp
    code, and i'm looking for verification of this and comments on the solution
    proposed in my previous message.

    again, here are the conditions that make this bug appear:
    1) windows 95 (although this shouldn't matter)
    2) comint-input-autoexpand --> 'history
    3) comint-process-echoes --> t

    incidentally, since they're buffer-local symbols, performing the 

    (setq comint-input-autexpand 'history) 

    and the 

    (setq comint-process-echoes t) 

    in the *scratch* buffer will not do what you want.  you must instead
    execute the command "eval-expression", and then type the expressions to it
    while in the *shell* buffer.  (there's probably a better way, but i don't
    know it :-)

    so, is there anyone out there for whom this also fails, or am i
    halucinating? 

another david's response (refering to the w95 comment):

    Actually, this DOES matter because Win95 uses command.com, not cmd.exe,
    as the command shell.  The arguments to command.com are different than
    for cmd.exe.  I have this working on my Win95 machine at home, but
    I've forgotten how it's set up :-(.  For Windows NT, I have
       (setq explicit-cmd.exe-args '("/q") )
    in my .emacs file.  I seem to recall that for Win95 I have
       (setq explicit-command.com-args nil)
    but I'll have to check that.

i'm not sure why i'm having so much trouble making myself clear here, but
i'll give it one more shot :-)

david (both of you), you would be right, if a particular path through the
elisp of comint.el were taken.  however the settings of the variables above
(incidentally shell.el sets comint-input-autoexpand to 'history) cause it
to take a different path.  this path contains a bug (i believe) that i
describe in a previous message.  i'm just trying to get a second opinion on
whether it's really a bug, at which point (i might not wait that long given
how this thread is progressing :-), i'll submit it to fsf (?).

thanks, everyone, for your patience, and i hope that some of this has been
edifying thus far.

-geo

From owner-ntemacs-users@june  Thu Sep 19 15:19:58 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "19" "September" "1996" "17:42:11" "EDT" "Andrew Innes" "andrewi@harlequin.com" nil "15" "Re: emacs and system shutdown" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id PAA16439 for <voelker@june.cs.washington.edu>; Thu, 19 Sep 1996 15:19:58 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA30755 for <voelker@joker.cs.washington.edu>; Thu, 19 Sep 1996 15:19:56 -0700
Received: from hilly.harlequin.com (hilly.harlequin.com [198.3.232.58]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA11845 for <ntemacs-users@cs.washington.edu>; Thu, 19 Sep 1996 14:43:47 -0700
Received: from epcot.harlequin.com by hilly.harlequin.com; Thu, 19 Sep 1996 17:42:15 -0400
Received: from romulus.harlequin.com by epcot.harlequin.com; Thu, 19 Sep 1996 17:42:12 -0400
Message-Id: <23983.9609192142@romulus.harlequin.com>
In-Reply-To: <199609191808.LAA04346@andyd2.scruznet.com> (aed@scruz.net)
From: Andrew Innes <andrewi@harlequin.com>
To: aed@scruz.net
Cc: ntemacs-users@cs.washington.edu
Subject: Re: emacs and system shutdown
Date: Thu, 19 Sep 96 17:42:11 EDT

On Thu, 19 Sep 1996 11:08:25 -0700, aed@scruz.net said:
>
>any idea why I can not shutdown my machine once I have started emacs?
>I always have to cycle the power :-( (yes I have quit emacs cleanly)

Probably because you are running Emacs on Windows 95, and you have left
a shell buffer open running command.com or some other DOS program.  On
Windows 95, Emacs cannot kill off DOS programs (as it tries to do when
you kill Emacs), and the end result of trying is that the DOS process
still exists as some sort of zombie process.

There is some documentation of this problem in the manual and the NEWS
file - type C-h n to read NEWS.

AndrewI

From owner-ntemacs-users@june  Tue Oct  1 18:19:37 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 1" "October" "1996" "17:25:38" "-0700" "Jonathan Payne" "jpayne@marimba.com" nil "13" "comint-previous-matching-input" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id SAA26513 for <voelker@june.cs.washington.edu>; Tue, 1 Oct 1996 18:19:37 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id SAA17965 for <voelker@joker.cs.washington.edu>; Tue, 1 Oct 1996 18:19:36 -0700
Received: from marimba.com (marimba.com [207.33.72.2]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id RAA20681 for <ntemacs-users@cs.washington.edu>; Tue, 1 Oct 1996 17:26:47 -0700
Received: from kirks.marimba.com by marimba.com (SMI-8.6/SMI-SVR4) 	id RAA09633; Tue, 1 Oct 1996 17:26:19 -0700
Received: by kirks.marimba.com (SMI-8.6/SMI-SVR4) 	id RAA26572; Tue, 1 Oct 1996 17:25:38 -0700
Message-Id: <199610020025.RAA26572@kirks.marimba.com>
In-reply-to: <9610012121.AA03303@nirvana.htc.honeywell.com> (hadden@htc.honeywell.com)
From: jpayne@marimba.com (Jonathan Payne)
To: ntemacs-users@cs.washington.edu
Subject: comint-previous-matching-input
Date: Tue, 1 Oct 1996 17:25:38 -0700

This is bound to Meta-R in shell windows I believe.  On my UNIX
machine, running 19.27, typing Meta-R repeatedly invokes the reverse
search on the previous string I used.

On the PC it seems to use the null string, and find the most recent
command I typed.  In order to keep going back in history I have to
re-type the same command repeatedly.

Is this an NT thing or a 19.33.1 thing, or what?

Thanks.

JP

From owner-ntemacs-users@june  Thu Oct 17 19:48:56 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "17" "October" "1996" "22:11:27" "EDT" "Peter Breton" "pbreton@dirac.i-kinetics.com" nil "37" "Directory change implicit in \"M-x compil" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id TAA03735 for <voelker@june.cs.washington.edu>; Thu, 17 Oct 1996 19:48:56 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id TAA32130 for <voelker@joker.cs.washington.edu>; Thu, 17 Oct 1996 19:48:54 -0700
Received: from ns.i-kinetics.com (ns.i-kinetics.com [198.69.254.24]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id TAA01613 for <ntemacs-users@cs.washington.edu>; Thu, 17 Oct 1996 19:12:41 -0700
Received: from i-kinetics.com (dirac [192.31.81.157]) by ns.i-kinetics.com (8.6.12/8.6.9) with SMTP id WAA20371; Thu, 17 Oct 1996 22:06:12 -0400
Received: by i-kinetics.com (4.1/SMI-4.1/UUNET) 	id AA17133; Thu, 17 Oct 96 22:11:27 EDT
Message-Id: <9610180211.AA17133@i-kinetics.com>
In-Reply-To: <199610180140.SAA11910@fandango.lucasarts.com>
References: <199610180140.SAA11910@fandango.lucasarts.com>
Reply-To: pbreton@i-kinetics.com
From: Peter Breton <pbreton@dirac.i-kinetics.com>
To: Bret Mogilefsky <mogul@lucasarts.com>
Cc: "'ntemacs-users@cs.washington.edu'" <ntemacs-users@cs.washington.edu>
Subject: Directory change implicit in "M-x compil
Date: Thu, 17 Oct 96 22:11:27 EDT


 Bret> My major problem is that there is no way to pin any
 Bret> compilations you do to a particular directory for all your
 Bret> buffers in compile.el.  Short of that, the default behavior is
 Bret> getting in my way: When I do M-x compile, compile.el inserts
 Bret> (insert "cd " thisdir "\n" command "\n") in the buffer prior to
 Bret> compilation, where "thisdir" is set to default-directory.
 Bret> Unfortunately, due to all of our terrific expand-file-name
 Bret> code, this string uses forward-slashes instead of back-slashes,
 Bret> which of course cmd.exe chokes on.  Does anyone have a
 Bret> suggestion for cleanly getting around this?

The 'compile-internal' function uses the value of default-directory,
which suggests to me that you could wrap compile in another function,
like this:

  (defun my-compile ()
	(interactive)
	(let ((default-directory (convert-slashes default-directory)))
	(call-interactively 'compile)))

'Convert-slashes' is left as an exercise for the reader :)

If you know that you'll _always_ _always_ want backslashes, advice is
probably the cleanest way to do it, perhaps like this:

  (defadvice compile (around use-backslashes activate)
	"Convert default directory to all backslashes"
	(let ((default-directory (convert-slashes default-directory)))
	ad-do-it
	))		


Note that I haven't tested either of these.
You could extend this idea to compile in any directory.

			Peter

From owner-ntemacs-users@june  Tue Oct 22 21:34:46 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "22" "October" "1996" "23:56:45" "-0400" "Jacob Colman" "jcolman@jnc.com" nil "21" "shell-mode problems" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id VAA28390 for <voelker@june.cs.washington.edu>; Tue, 22 Oct 1996 21:34:45 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id VAA33741 for <voelker@joker.cs.washington.edu>; Tue, 22 Oct 1996 21:34:41 -0700
Received: from j51.com (gorplex.j51.com [199.224.7.51]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id UAA26766 for <ntemacs-users@cs.washington.edu>; Tue, 22 Oct 1996 20:57:48 -0700
Received: from jcolman.jnc.com (pmb4.j51.com [165.254.214.36]) by j51.com (8.7.5/8.6.12) with SMTP id XAA27428 for <ntemacs-users@cs.washington.edu>; Tue, 22 Oct 1996 23:54:54 -0400 (EDT)
Message-Id: <2.2.32.19961023035645.00696100@pop.j51.com>
X-Sender: jcolman@pop.j51.com
X-Mailer: Windows Eudora Pro Version 2.2 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: "Jacob Colman (JNC Consulting Group)" <jcolman@jnc.com>
To: ntemacs-users@cs.washington.edu
Subject: shell-mode problems
Date: Tue, 22 Oct 1996 23:56:45 -0400

I am having problems with shell-mode.  I have implemented some of the
suggestions given me by other users but I am not having much luck.  Using
the prebuilt distribution, shell-mode works for the most part provided I set
"comint-process-echoes t".  I have recently downloaded source code and done
my own build and now I am getting ^M at the end of every line.  I can
correct it by spcifying a comint hook to stip ^M and that works well.
Process shells, however, (such as that used by diff, grep, compile, etc.)
still have the ^M.  This becomes a problem whrn using ediff since it cannot
parse the diffs buffer.

The prebuilt distribution was apparantly built using NT4.0 (at least so says
emacs-version). Mine was built using NT351, and MSVC 4.2.  Can this be the
difference?

In any case, for NT351, what is the appropriate way to configure shell-mode
such that both interactive and non-interactive shells work properly?
---
Jake Colman                     email: jcolman@jnc.com
JNC Consulting Group Inc.       Phone: (914) 368-2765
42 Olympia Lane                 FAX  : (914) 368-2765
Monsey, NY  10952

From owner-ntemacs-users@june  Wed Oct 23 06:59:08 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "23" "October" "1996" "08:56:21" "-0400" "Michael Welsh Duggan" "md5i@schenley.com" nil "32" "Re: shell-mode problems" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id GAA22366 for <voelker@june.cs.washington.edu>; Wed, 23 Oct 1996 06:59:08 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id GAA26487 for <voelker@joker.cs.washington.edu>; Wed, 23 Oct 1996 06:59:05 -0700
Received: from maru.schenley.com (maru.schenley.com [206.62.188.70]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id FAA18018 for <ntemacs-users@cs.washington.edu>; Wed, 23 Oct 1996 05:57:05 -0700
Received: by maru.schenley.com from localhost     (router,SLmailNT V2.0); Wed, 23 Oct 1996 08:56:23 EDT
Received: by maru.schenley.com from maru.schenley.com     (127.0.0.1::mail daemon; unverified,SLmailNT V2.0); Wed, 23 Oct 1996 08:56:22 EDT
References: <2.2.32.19961023035645.00696100@pop.j51.com>
In-Reply-To: "Jacob Colman's message of Tue, 22 Oct 1996 23:56:45 -0400
Message-ID: <uohht6dqi.fsf@maru.schenley.com>
Lines: 32
X-Mailer: Gnus v5.2.37/Emacs 19.32
From: "Michael Welsh Duggan" <md5i@schenley.com>
Sender: "Michael Welsh Duggan" <md5i@schenley.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: shell-mode problems
Date: 23 Oct 1996 08:56:21 -0400

"Jacob Colman (JNC Consulting Group)" <jcolman@jnc.com> writes:

> 
> I am having problems with shell-mode.  I have implemented some of the
> suggestions given me by other users but I am not having much luck.  Using
> the prebuilt distribution, shell-mode works for the most part provided I set
> "comint-process-echoes t".  I have recently downloaded source code and done
> my own build and now I am getting ^M at the end of every line.  I can
> correct it by spcifying a comint hook to stip ^M and that works well.
> Process shells, however, (such as that used by diff, grep, compile, etc.)
> still have the ^M.  This becomes a problem whrn using ediff since it cannot
> parse the diffs buffer.
> 
> The prebuilt distribution was apparantly built using NT4.0 (at least so says
> emacs-version). Mine was built using NT351, and MSVC 4.2.  Can this be the
> difference?

Yes, at least to the 4.2 part.  This can be fixed by changing the
following line in sys_pipe() in nt.c.

  rc = _pipe (phandles, 0, _O_NOINHERIT);

to

  rc = _pipe (phandles, 0, _O_TEXT | _O_NOINHERIT);

I believe that in the next version, emacs will not rely on the default
text-mode CR stripping.

-- 
Michael Duggan
(md5i@schenley.com)

From owner-ntemacs-users@june  Fri Nov 22 16:04:08 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" "22" "November" "1996" "15:14:27" "-0800" "Jeff Finger" "jfinger@adobe.com" nil "20" "winnt.el fix for command completion slashes" "^From:" nil nil "11" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3/7.2ju) with SMTP id QAA29078 for <voelker@june.cs.washington.edu>; Fri, 22 Nov 1996 16:00:56 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id QAA30151 for <voelker@joker.cs.washington.edu>; Fri, 22 Nov 1996 16:00:54 -0800
Received: from smtp-relay-1.Adobe.COM (smtp-relay-1.adobe.com [192.150.11.1]) by june.cs.washington.edu (8.8.3/7.2ju) with ESMTP id PAA25283 for <ntemacs-users@cs.washington.edu>; Fri, 22 Nov 1996 15:14:00 -0800
Received: by smtp-relay-1.Adobe.COM (8.7.5) with ESMTP id PAA20446; Fri, 22 Nov 1996 15:13:13 -0800 (PST)
Received: by inner-relay-2.Adobe.COM (8.7.5) with ESMTP id PAA12164; Fri, 22 Nov 1996 15:13:16 -0800 (PST)
Received: by elroy.corp.Adobe.COM (8.7.5) with SMTP id PAA06737; Fri, 22 Nov 1996 15:14:28 -0800 (PST)
Message-Id: <199611222314.PAA06737@elroy.corp.Adobe.COM>
Phone: (408) 536-2047
Office: SJ W14-422
From: jfinger@Adobe.COM (Jeff Finger)
Sender: jfinger@Adobe.COM
To: ntemacs-users@cs.washington.edu
Subject: winnt.el fix for command completion slashes
Date: Fri, 22 Nov 1996 15:14:27 -0800

Paul_Koning@3mail.3Com.COM just pointed out to me that
> You can add your shell hook at the end, see the elisp docs.
> (In brief: there's an optional 3rd argument to add-hook; if not nil, the
> new hook is added to the end rather than the start of the list.)

This is obviously a much better solution. Thanks, Paul!

Jeff Finger

>From M-x describe-function:
    add-hook: a compiled Lisp function.
    (add-hook HOOK FUNCTION &optional APPEND LOCAL)

    Add to the value of HOOK the function FUNCTION.
    FUNCTION is not added if already present.
    FUNCTION is added (if necessary) at the beginning of the hook list
    unless the optional argument APPEND is non-nil, in which case
    FUNCTION is added at the end.

    ...

From owner-ntemacs-users@cs.washington.edu  Tue Jul  1 09:19:35 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 1" "July" "1997" "08:27:24" "-0700" "chrisc@analogy.com" "chrisc@analogy.com" nil "27" "Shell in shell mode is not a tty" "^From:" nil nil "7" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id JAA06100 for <voelker@june.cs.washington.edu>; Tue, 1 Jul 1997 09:19:34 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id JAA33122 for <voelker@joker.cs.washington.edu>; Tue, 1 Jul 1997 09:19:32 -0700
Received: (majordom@localhost) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) id IAA01574 for ntemacs-users-outgoing; Tue, 1 Jul 1997 08:36:18 -0700 (PDT)
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id IAA01570 for <ntemacs-users@trout.cs.washington.edu>; Tue, 1 Jul 1997 08:36:16 -0700 (PDT)
Received: from services (services.analogy.com [149.117.1.2]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id IAA03398 for <ntemacs-users@cs.washington.edu>; Tue, 1 Jul 1997 08:36:14 -0700
Received: from analogy.com (analogy.analogy.com) by services (5.x/SMI-SVR4) 	id AA05630; Tue, 1 Jul 1997 08:37:19 -0700
Received: from exchange.analogy.com by analogy.com (4.1/Shared_Spool_1.3) 	id AA16617; Tue, 1 Jul 97 08:35:40 PDT
Received: by exchange.analogy.com with Internet Mail Service (5.0.1457.3) 	id <KQML8KDP>; Tue, 1 Jul 1997 08:27:27 -0700
Message-Id: <07E50AC2610AD01194D600805FE27DF8305AC3@exchange.analogy.com>
X-Priority: 3
Mime-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1457.3)
Content-Type: text/plain
Precedence: bulk
From: chrisc@analogy.com
Sender: owner-ntemacs-users@cs.washington.edu
To: ntemacs-users@cs.washington.edu
Subject: Shell in shell mode is not a tty
Date: Tue, 1 Jul 1997 08:27:24 -0700

Hi All,

  I am running 19.34 ntemacs on windows nt 4.0.
I am using mks shell. 

  I have noticed that some commands hang when executed in shell mode of
ntemacs but not when executed from the dos command line. 

 The reason, in my case, for this is that the shell in shell mode is not
a tty. This is confirmed by typing tty, the response will be "not a
tty". If I type tty on the dos command line window running mks shell I
get "CONS$0". I have looked at the source for the programs with the
problem and found a block that checks if the shell is a tty if not
nothing is sent to stdout. 

  Does anyone know how I can make my shell in shell mode be a tty?

I have noticed alot of email concerned with shell mode ntemacs problems.
THis may be the cause of alot of it.


Thanks,


Chris Campbell

Analogy, Beaverton OR USA

