From owner-ntemacs-users@june  Thu Aug 29 09:14:01 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "29" "August" "1996" "11:22:07" "-0400" "Peter Breton" "pbreton@volte.i-kinetics.com" nil "79" "3rd party shell or not?" "^From:" nil nil "8" 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 JAA01861 for <voelker@june.cs.washington.edu>; Thu, 29 Aug 1996 09:14:00 -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 JAA43212 for <voelker@joker.cs.washington.edu>; Thu, 29 Aug 1996 09:13:59 -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 IAA27250 for <ntemacs-users@cs.washington.edu>; Thu, 29 Aug 1996 08:23:57 -0700
Received: (Unknown UID 8@localhost) by ns.i-kinetics.com (8.6.11/8.6.5) id LAA25902 for <ntemacs-users@cs.washington.edu>; Thu, 29 Aug 1996 11:23:52 -0400
Received: from dirac.i-kinetics.com(192.31.81.157) by ns.i-kinetics.com via smap (V1.3) 	id sma025900; Thu Aug 29 11:23:41 1996
Received: from volte.i-kinetics.com by i-kinetics.com (4.1/SMI-4.1/UUNET) 	id AA21797; Thu, 29 Aug 96 11:21:31 EDT
Received: by volte.i-kinetics.com (SMI-8.6/SMI-SVR4) 	id LAA13045; Thu, 29 Aug 1996 11:22:07 -0400
Message-Id: <199608291522.LAA13045@volte.i-kinetics.com>
Reply-To: pbreton@i-kinetics.com
From: Peter Breton <pbreton@volte.i-kinetics.com>
To: ntemacs-users@cs.washington.edu
Subject: 3rd party shell or not?
Date: Thu, 29 Aug 1996 11:22:07 -0400


I've followed the discussions about 3rd party shells with interest,
and I'm wondering whether one is better off using one (bugs and all) 
or trying instead to use Emacs shell-mode and add-ons to add features 
to the native shell.  This assumes, of course, that you run shells inside 
emacs almost all the time, since if you run it outside emacs all these
advantages vanish.

Let me play the part of an advocate of Emacs + native shell. (Of course,
I use NT almost exclusively, and its' native shell is (from what I hear)
considerably better than the win95 one.)

1) As scripting languages, any of the native shells suck. However, I would
counter that I'd simply use Perl5 or Python as a scripting language, which
is very probably at least as powerful as what the 3rd party shells provide,
and cross-platform to boot. The only thing you lose is shell functions 
(which not all the 3rd party shells provide anyway).

2) Shell-mode provides:

  a) Visual recall/editing
  b) Filename completion
  c) Command completion
  d) History substitution (!!, !-n, !$, !*, etc)
  e) User-defined completion (which none of the shells do, AFAIK)
  f) Emulation of some of the shells features (fignore, echoing commands, etc)
     These are listed in the manual, or you can inspect comint.el and 
     shell.el.

   And of course:
  *) Key-bindings
  *) Integration with other emacs features

3) Emacs packages (not in standard distribution)

  I've been looking at adapting Simon Marshall's shellc and shelldb packages
  for NTEmacs (it looks pretty straightforward). These allow completion
  of command options, usernames, hostnames, etc, much like tcsh.

4) User add-ons

  a) You could fake aliases with abbrevs (as a quick-n-dirty solution),
     something like this:

	(defun pb-enhanced-space (arg)
	  (interactive "p")
	  (let ((comint-commandp))
	    (save-excursion
	      (comint-bol nil)
	      (setq comint-commandp (looking-at "[ \t]*\\(\\sw*\\)$")))
	    (if comint-commandp
		(expand-abbrev))
	    (comint-magic-space arg)))

  b) You could define a completion function to do aliases

  c) You could define a completion function to emulate CDPATH

What I see still missing:

1) Fileglobbing in emacs. The native file globbing isn't as powerful as
a traditional Unix shell. The NT Perl distribution has a globbing
program (perlglob), perhaps this could be used.

2) The NT shell lets you associate programs with file extensions, I don't
think the Win95 shell does. However, you could do this inside emacs in a
very powerful way, by having a regexp/command pair, much like auto-mode-alist
or interpreter-mode-alist. If a command matched the regexp, the appropriate
command would be inserted.

Annoying bugs:

1) Directory tracking is very easy to fool. The docs say that it is "a
half-assed solution" (that's an exact quote! :), under NTEmacs it seems
even easier to trick.

Comments? Did I miss anything?

			Peter

From owner-ntemacs-users@june  Tue Aug 20 14:56:20 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "21" "August" "1996" "09:09:00" "+1300" "Jason Rumney" "jasonr@pec.co.nz" nil "28" "Re: problem with auto-compression-mode" "^From:" nil nil "8" 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 OAA16823 for <voelker@june.cs.washington.edu>; Tue, 20 Aug 1996 14:56:20 -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 OAA37412 for <voelker@joker.cs.washington.edu>; Tue, 20 Aug 1996 14:56:19 -0700
Received: from janus.pec.co.nz (janus.pec.co.nz [202.20.64.195]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA09418 for <ntemacs-users@cs.washington.edu>; Tue, 20 Aug 1996 14:08:05 -0700
Received: from pachinko.pec.co.nz (pachinko.pec.co.nz [202.36.208.29]) by janus.pec.co.nz (8.6.11/8.6.11) with SMTP id JAA14785 for <ntemacs-users@cs.washington.edu>; Wed, 21 Aug 1996 09:09:12 +1200
References: <199608161809.OAA07769@severi.mit.edu> 	<x720h79ju3.fsf@unilab.dfci.harvard.edu> <m0usmn9-000AzYC@mail>
X-Url: http://www.pec.co.nz/~jasonr/
Mail-Copies-To: never
In-Reply-To: Ronan Waide's message of Tue, 20 Aug 96 09:08:07 +0000 (GMT)
Message-ID: <wklof9u8bn.fsf@pachinko.pec.co.nz>
Lines: 28
X-Mailer: Gnus v5.2.25/Emacs 19.31
From: Jason Rumney <jasonr@pec.co.nz>
Sender: jasonr@pec.co.nz
To: ntemacs-users@cs.washington.edu
Subject: Re: problem with auto-compression-mode
Date: 21 Aug 1996 09:09:00 +1300

In article <m0usmn9-000AzYC@mail>, Ronan Waide <waider@autodealing.com> writes:

> I know there's a 32-bit shell of some sort provided with Perl for
> Win32 (check out www.perl.hip.com) which they use to get around some
> inconsistencies in return codes from COMMAND.COM; I don't know if it
> would have any other effects on the behaviour of the shell but it
> might be worth a try.

Perfect.  I could never get ange-ftp or ediff working properly with
bash, but hexl, metamail and others wouldn't work with command.com.

Now I've got everything I want working with just the following in my
.emacs (and the SHELL set in registry to D:\PERL5\BIN\CMD32.EXE)


(setq shell-command-switch "")
(setq ange-ftp-tmp-name-template "e:/tmp/ange-ftp")
(setq hexlify-command "D:\\Emacs-19.31\\bin\\hexl -iso")
(setq dehexlify-command "D:\\Emacs-19.31\\bin\\hexl -de")
 


-- 
------------------------------------------------------------------------
Don't ask me what I think of you, I might not give the answer
that you want me to.
        - Fleetwood Mac
-------------------------------- Jason Rumney <jasonr@pec.co.nz> -------

From mbk@choh001.cho.ge.com  Tue Oct  1 07:52:33 1996
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	[nil "Tue" " 1" "October" "1996" "10:51:50" "-0400" "Mike Krell" "mbk@choh001.cho.ge.com" "<199610011454.KAA23303@ns.ge.com>" "29" "Re: compiling within 19.34" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from ns.ge.com (ns.ge.com [192.35.39.24]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id HAA18828 for <voelker@cs.washington.edu>; Tue, 1 Oct 1996 07:52:32 -0700
Received: from choh081.cho.ge.com ([3.16.17.81]) by ns.ge.com (8.7.5/8.7.3) with SMTP id KAA23303 for <voelker@cs.washington.edu>; Tue, 1 Oct 1996 10:54:58 -0400 (EDT)
Message-Id: <199610011454.KAA23303@ns.ge.com>
Received: by choh081.cho.ge.com 	(1.37.109.8/16.2) id AA04202; Tue, 1 Oct 1996 10:51:50 -0400
In-Reply-To: <199609290556.WAA28822@joker.cs.washington.edu>
References: <199609111314.JAA17067@ns.ge.com> 	<199609290556.WAA28822@joker.cs.washington.edu>
From: Mike Krell <mbk@choh001.cho.ge.com>
To: voelker@cs.washington.edu (Geoff Voelker)
Subject: Re: compiling within 19.34
Date: Tue, 1 Oct 1996 10:51:50 -0400

>From the quill of Geoff Voelker:

 > dunno if this is still haunting you, but it appears that stderr is being
 > redirected to some black hole.  can you check whether you get the same
 > behavior while using some other shell (like cmd.exe if you are NT)?

I fixed the problem by forcing bash to run an interactive shell.  I also
changed my bash startup files some so that now I have one which only does
environment variable settings, as so:

(setq shell-file-name "c:\\bash\\bin\\bash.exe")
(setq shell-command-switch "-rcfile c:\\mbk\\.bashrc_env -i -c")
(setq hexlify-command "hexl -hex ")
(setq dehexlify-command "hexl -hex -de ")

With these settings, I was still having a problem with hexl mode in that
saving a hexl buffer corrupted the file.  (It appeared to "hexlify" the
buffer contents _again_ before writing to the file instead of "dehexlifying"
them, if you follow me.)  I've just stumbled onto a fix for this problem
this morning: I need to quote the hexlify and dehexlify commands:
 
    (setq hexlify-command "\"hexl -hex \"")
    (setq dehexlify-command "\"hexl -hex -de \"")

I'm not sure why I need to do this, but it appears to work.

     Mike                                    mike.krell@cho.ge.com

"Never miss a good chance to shut up." -- Scott Beach's grandfather

