Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!husc6!sri-unix!ctnews!pyramid!decwrl!labrea!goose!conor
From: conor@goose.UUCP
Newsgroups: comp.emacs
Subject: shell-util.el
Message-ID: <33@goose.UUCP>
Date: Fri, 4-Dec-87 20:00:46 EST
Article-I.D.: goose.33
Posted: Fri Dec  4 20:00:46 1987
Date-Received: Wed, 9-Dec-87 20:02:37 EST
References: <32@goose.UUCP>
Reply-To: conor@dutch-goose.stanford.edu (Conor S. Rafferty)
Organization: Integrated Circuits Lab. Stanford University
Lines: 33
Keywords: syntactic sugar

Due to brain leakage, I posted a shell utility package to
comp.windows.x instead of comp.emacs. Here's a duplicate of the description;
the lisp code can be found over there.


A new version of gnumacs just came up for me with a minimum of bother.
To express my gratitude :) I have collected a few little hacks I use
to make interaction with subshells more convenient. Particularly subshells
containing dbx. The first hack, called shell-repeat, takes an expression like
    print pt[nd[0:2]->pt]->cord
and turns it into
    print pt[nd[0]->pt]->cord; print pt[nd[1]->pt]->cord; print pt[nd[2]->pt]->cord

Vi lovers have said it's almost enough to convert them :-)

The second hack is called just-like-csh and does what you would expect.
!!	repeats the previous command
!a	repeats the previous command starting with an a
!?abc	repeats the previous command containing abc

just-like-csh relies on shell and telnet windows copying user input
lines into a buffer called *history*. That requires a minor change
in both shell.el and telnet.el.

It has already been pointed out that just-like-csh is a misnomer,
since it doesn't try to get !$ or !-2. Call it sorta-kinda-like-csh if
you like :)

---
             conor rafferty    The command
  conor@sierra.stanford.edu       1,$s/^\([^,]*\), *\(.*\)/\2 \1/
decwrl!glacier!conor@sierra    although hard to read, does the job.
                           --- Brian W. Kernighan "Advanced Editing on Unix"