From decwrl!ucbvax!ucsd!usc!cs.utexas.edu!uunet!allbery Mon May  7 07:38:19 PDT 1990
Article 1510 of comp.sources.misc:
Path: decwrl!ucbvax!ucsd!usc!cs.utexas.edu!uunet!allbery
From: argv@Eng.Sun.COM (Dan Heller)
Newsgroups: comp.sources.misc
Subject: v12i030: Mail User's Shell, Part02/19
Message-ID: <87532@uunet.UU.NET>
Date: 5 May 90 17:12:57 GMT
Sender: allbery@uunet.UU.NET
Lines: 1722
Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)

Posting-number: Volume 12, Issue 30
Submitted-by: argv@Eng.Sun.COM (Dan Heller)
Archive-name: mush/part02

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of archive 2 (of 19)."
# Contents:  mush/makefile.sun mush/mush.1.a
# Wrapped by argv@turnpike on Wed May  2 13:59:19 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'mush/makefile.sun' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mush/makefile.sun'\"
else
echo shar: Extracting \"'mush/makefile.sun'\" \(2253 characters\)
sed "s/^X//" >'mush/makefile.sun' <<'END_OF_FILE'
X# makefile.sun	(c) copyright 1986	(Dan Heller)
X#
XHDRS= mush.h config.h-dist strings.h bindings.h options.h version.h glob.h
X
XSRCS= addrs.c bind.c commands.c curs_io.c curses.c dates.c doproc.c \
X      execute.c expr.c file.c fkeys.c folders.c glob.c hdrs.c init.c lock.c \
X      loop.c macros.c mail.c main.c malloc.c misc.c misc_frame.c msgs.c \
X      options.c panels.c pick.c print.c hdr_sw.c setopts.c signals.c sort.c \
X      strings.c tool.c tooledit.c viewopts.c
X
XOBJS= addrs.o bind.o commands.o curs_io.o curses.o dates.o doproc.o \
X      execute.o expr.o file.o fkeys.o folders.o glob.o hdrs.o init.o lock.o \
X      loop.o macros.o mail.o main.o malloc.o misc.o misc_frame.o msgs.o \
X      options.o panels.o pick.o print.o hdr_sw.o setopts.o signals.o sort.o \
X      strings.o tool.o tooledit.o viewopts.o
X
XIMAGES= mail.icon.1 mail.icon.2
X
XHELP_FILES= README README-7.0 README-7.1 mush.1 cmd_help tool_help \
X            Mushrc Mailrc Gnurc advanced.mushrc sample.mushrc digestify
X
XMAKES= makefile.sun makefile.bsd makefile.sys.v makefile.xenix makefile.hpux
X
X# If your SunOS version is 3.5, add -DSUN_3_5 to CFLAGS.
X# If your SunOS version is 4.1, add -DSUN_4_1 to CFLAGS.
X# If you are not using SUNTOOL, use makefile.bsd and add one of
X#	-DSUN_3_5, -DSUN_4_0, or -DSUN_4_1 to CFLAGS there.
XCFLAGS= -O -DSUNTOOL -DCURSES -DBSD
XLDFLAGS=
XLIBES= -lcurses -ltermlib -lsuntool -lsunwindow -lpixrect
XOTHERLIBS=
X# Use some variant of this one if you #define MMDF in config.h
X#OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
XLINTFLAGS= -bxah -Dlint
X
Xmush: $(OBJS)
X	@echo loading...
X	@cc $(LDFLAGS) $(OBJS) $(LIBES) $(OTHERLIBS) -o mush
X
X$(OBJS): config.h mush.h
Xloop.o: version.h
X
Xlint:
X	lint $(LINTFLAGS) $(SRCS) -DSUNTOOL -DCURSES -DBSD
X
Xclean:
X	rm -f *.o core mush
X
XBINDIR= /usr/local/bin
XLIBDIR= /usr/local/lib
XMRCDIR= /usr/lib
XMANDIR= /usr/local/man/man1
XMANEXT= 1
X
Xinstall: mush
X	mv mush $(BINDIR)
X	strip $(BINDIR)/mush
X	chmod 0755 $(BINDIR)/mush
X	rm -f $(BINDIR)/mushtool
X	ln -s $(BINDIR)/mush $(BINDIR)/mushtool
X	cp mush.1 $(MANDIR)/mush.$(MANEXT)
X	chmod 0644 $(MANDIR)/mush.$(MANEXT)
X	cp tool_help $(LIBDIR)
X	chmod 0644 $(LIBDIR)/tool_help
X	cp cmd_help $(LIBDIR)
X	chmod 0644 $(LIBDIR)/cmd_help
X	cp Mushrc $(MRCDIR)/Mushrc
X	chmod 0644 $(MRCDIR)/Mushrc
END_OF_FILE
if test 2253 -ne `wc -c <'mush/makefile.sun'`; then
    echo shar: \"'mush/makefile.sun'\" unpacked with wrong size!
fi
# end of 'mush/makefile.sun'
fi
if test -f 'mush/mush.1.a' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mush/mush.1.a'\"
else
echo shar: Extracting \"'mush/mush.1.a'\" \(50598 characters\)
sed "s/^X//" >'mush/mush.1.a' <<'END_OF_FILE'
X.\" Mush Man Page: Copyright (c) 1987, 1989, 1990 Dan Heller
X.\" Cleaned up January 1988 by Bart Schaefer <schaefer@cse.ogc.edu>
X.\" Patched again December 1989 by Bart Schaefer <schaefer@cse.ogi.edu>
X.\" 1990 updates also by Bart Schaefer <schaefer@cse.ogi.edu>
X.\"
X.if n .ds Q \&"
X.if n .ds U \&"
X.if t .ds Q \&``
X.if t .ds U \&''
X.if n .ds - --
X.if t .ds - \(em
X.nh
X.TH MUSH 1 "Apr 25, 1990" "Version 7.1.0"
X.UC 4
X.SH NAME
XThe Mail User's Shell \- Shell for electronic mail.
X.SH SYNOPSIS
X.B mush
X[
X.B \-n
X]
X[
X.B \-v
X]
X[
X.B \-s
Xsubject
X]
X[
X.B \-c
Xcc-list
X]
X[
X.B \-b
Xbcc-list
X]
X[
Xaddress-list
X]
X.br
X.B mush
X[
X.B \-n
X]
X[
X.B \-v
X]
X[
X.BR \-U [ ! ]
X]
X.B \-h
Xdraft-file
X.br
X.B mush
X[
Xmode-options
X]
X[
Xfile-options
X]
X.SH INTRODUCTION
XThe Mail User's Shell (Mush) is an interface for sending and manipulating
Xa database of electronic mail messages under the
X.IR UNIX (TM)
Xenvironment.
XThere are three user interfaces that allow the user to interact with
X.I Mush.
XThe default interface is the conventional tty-based line mode
Xsimilar to command line interpreters such as
X.I csh
Xas well as other mailers, such as University of California, Berkeley's
X.I Mail
Xand Bell Lab's System V
X.I mailx
Xinterface.
XThis mode requires nothing from the terminal in terms of screen
Xcapability and may be run on many different versions of the
X.IR UNIX (TM)
Xoperating system.
X.PP
XThe text-graphics
X.RI ( curses )
Xinterface is reminiscent of the
X.I vi
Xvisual editor, but is user-configurable to simulate other editors.
XThis interface does not require graphics capabilities of
Xthe computer or the terminal on which it is run, but the terminal must
Xhave the minimum capabilities required by any visual screen editor.
X.PP
XThe
X.I window
Xinterface for the Sun Workstation utilizes the icon and
Xmenu based (mouse selectable) windowing system.
XThis
X.I tool
X(graphics) mode is highly subject to the version of operating system
Xyour Sun may be running.
XIt is intended to be run on Sun versions 3.5 and higher (those that have the
XSunView window system).
X.PP
XSee the corresponding sections for more information on the user
Xinterface desired.
XMost of this manual deals with commands, variables
Xand actions that are common to all three interfaces although
Xsome attention is paid to individual characteristics of each interface.
X.PP
XThe following command line arguments are understood by
X.I Mush
X(full word forms in parentheses):
X.TP
X\-b bcc-list
X(\-blindcarbon, \-blind)
XThe list of Blind Carbon Copy recipients is set on the command line.
XIf more than one address or an address containing spaces is specified, the
Xentire list should be enclosed in quotes.
XThis option applies when sending mail only.
XIf you are entering the shell, curses mode, or the tool mode, this option is
Xignored.
X.TP
X\-C
X(\-curses)
XEnter the mailer in curses mode upon startup.
X.TP
X\-c cc-list
X(\-carbon, \-copy)
XThe list of Carbon Copy recipients is set on the command line.
XIf more than one address or an address containing spaces is specified, the
Xentire list should be enclosed in quotes.
XThis option applies when sending mail only.
XIf you are entering the shell, curses mode, or the tool mode, this option is
Xignored.
X.TP
X\-d
X(\-debug)
XTurns on the debugging level to 1.
XYou can change debugging levels from within the shell using the
X.B debug
Xcommand.
X.TP
X\-e
X(\-echo)
XNormally, the program runs with the local echo off and each character
Xtyped is processed individually so as to process certain macros and
Xkeyboard mappings.
XThis option will suppress this from taking place
Xand the program will only process input after a carriage return has
Xbeen hit.
XUnder normal circumstances, this action is transparent to
Xthe user and the use of this option is discouraged except when using
Xa debugger with the program.
XNote that if this option is specified,
Xany key sequence set by map or map! will not take place.
XThis option is ignored for curses mode.
X.TP
X\-F[!] filename
X(\-source)
XThis file is the same type as the initialization file read on startup
X(see INITIALIZATION) with the exception that commands that manipulate
Xor search messages may be given.
XNormally, such commands may not appear in the initialization file since
Xthat file is read before the folder is scanned.
XThe file specified by \-F is read after the folder is scanned, so
Xcommands that affect messages are allowed.
XThe optional `!' argument prevents the shell from running after the
Xfile has been sourced.
XOtherwise,
X.I Mush
Xcontinues into whatever interface has been specified.
X.TP
X\-f [ filename ]
X(\-folder)
XThe optional filename argument specifies a folder containing mail messages.
XWith no argument,
X.B mbox
Xin the current directory (or the variable
X.BR mbox )
Xis used.
XIf no filename is given, this option must be last on the command line.
X.TP
X\-H[:c]
X(\-headers)
XHave
X.I Mush
Xdisplay mail headers without entering the shell.
XSee the
X.B headers
Xcommand for information on the
X.B :c
Xargument.
XNo colon modifier is equivalent to \*Q\-H:a\*U.
XThis option prevents the shell from running, so this option will turn off the
X\-S and \-C flags.
XThis option is ignored if the tool mode is in effect.
X.TP
X\-h draft-file
X(-draft)
XThis option specifies a previously prepared message file (called a draft)
Xwhich will be read in as a new message to be sent.
XThe current implementation requires that the draft file must contain all the
Xmessage headers;
X.I Mush
Xwill add only a new \*QDate:\*U and a \*QFrom:\*U header if there is none.
XIf there is no \*QTo:\*U header, the draft will not be sent.
XSee the
X.B mail
Xcommand and the section on \*QSending mail\*U for more information.
X.TP
X\-I[!] filename
X(\-init)
XThis option specifies an initialization file to be read
X.I before
Xany of the other
X.I Mush
Xinitialization is done.
XThe file specified by \-I is read before the default system initialization
Xfile is read (see the INITIALIZATION section for details).
XThe optional `!' argument prevents
X.I Mush
Xfrom reading the default system file, so \-I! can be used to specify a
Xsubstitute default file.
XThe user's personal initialization file is read normally.
X.TP
X\-i
X(\-interact)
XForces interactive mode even if input has been redirected to the program.
XThis is intended for remote host mail sessions (with -e) but also allows
Xthe user to redirect input from a \*Qscript\*U of
X.I Mush
Xcommands.
XSee the INITIALIZATION and MUSH SCRIPTS sections for information on how to
Xwrite scripts that deal with mail.
XNote that this flag is different from the \*Qignore\*U flag of UCB Mail.
X.TP
X\-m mailbox-path
X(\-mailbox)
XThe mailbox specified will be interpreted as if it were the user's main
X(system) mailbox in place of /usr/spool/mail/$USER (or whatever path is
Xapplicable for your system and Mail Transport Agent).
X.TP
X\-N
X(\-noheaders)
XEnter
X.I Mush
Xwithout displaying any message headers.
XThis argument is passed to the
X.B folder
Xcommand.
X.TP
X\-n[!]
X(\-noinit)
XNo initialization is done on start up.
XThat is, do not source the default system initialization files.
XIf the `!' argument is given, reading of the user's personal
X.I .mushrc
Xor
X.I .mailrc
Xfiles is also suppressed.
XSee the INITIALIZATION section for more information on
Xstartup and the significance of these files.
X.TP
X\-r
X(\-readonly)
XInitialize the folder in Read-Only mode; no modification of the folder is
Xpermitted.
XThis argument is passed on to the
X.B folder
Xcommand.
X.TP
X\-S
X(\-shell)
XThis flag allows the user to enter the shell even if the system
Xmailbox or specified folder is empty or doesn't exist.
X.TP
X\-s subject
X(\-subject)
XThe subject is set on the command line using this flag.
XIf the subject has
Xany spaces or tabs, the entire subject should be enclosed in quotes.
XThis applies when sending mail only.
XIf you are entering the shell,
Xcurses mode, or the tool mode, this option is ignored.
X.TP
X\-T timeout
X(\-timeout)
XIn the tool mode (Sun only),
X.I timeout
Xspecifies the length of time (seconds) to wait between each check for new mail.
X30 seconds is the smallest time allowed for performance reasons;
X60 seconds is the default value.
XThis option should be used either in place of \-t or immediately after it.
X.TP
X\-t
X(\-tool)
XUse the graphics tool mode (Sun only).
XThis option must be the first one on the command line, before any Sun window
Xsystem flags or other \fIMush\fR options.
X.sp
X.I
XNOTE:  The \-t option is obsolete and may be eliminated in future revisions.
XThe preferred way to run the tool mode of \fIMush\fR is to use the command
X.BR mushtool ,
Xwhich is a link to
X.BR mush .
X.TP
X\-u [ user ]
X(\-user)
XThe mailbox to use is /usr/spool/mail/\fBuser\fR.
XIf the login name for user is not specified, then root is used.
X.TP
X\-U[!]
X(-send)
XThis option may be used only with \-h (\-draft).
XIt causes the draft file to be sent immediately without further editing
X(\*Qunedited\*U, hence \-U).
XIf the optional `!' is appended, signatures and fortunes are suppressed.
XSee the
X.B mail
Xcommand and the section on \*QSending mail\*U for more information.
X.TP
X\-v
X(\-verbose)
XVerbose mode is turned on.
XThis option is passed to the actual mail delivery
Xsubsystem internal to your version of
X.IR UNIX (TM).
XSome mailers do not have a verbose option, so this flag may not apply
Xto your system (System V, for example).
XThis applies when sending mail only.
XIf you are entering the shell,
Xcurses mode, or the tool mode, this option is ignored.
X.SH "GENERAL USAGE"
XBecause there are three different interfaces available to the user,
Xthe tty characteristics (backspace, kill-word, kill-line, redraw line)
Xare simulated identically in all interfaces.
XWhen the user has to type something, the 4.2BSD style of tty driver interface
Xis simulated whether you're in the window system, the curses mode, or
Xthe tty-line
Xmode, and even on System-V machines.
XThis means that backspacing causes a
Xbackspace-space-backspace effect (erasing the character backspaced over).
XThe user may reset his tty characteristics using the
X.B stty
Xcommand.
X.PP
X.IR "New mail" .
X.PP
XIf during a
X.I Mush
Xsession, new mail arrives for you, it is automatically incorporated into
Xyour system mailbox and you are told that new mail has arrived.
X.PP
XIn the default line mode, new mail is checked between each command
Xissued.
XIn the curses mode, new mail is checked on each
Xcommand and is displayed in the bottom line of the screen.
XIn the tool based graphics mode, new mail is checked approximately
Xevery minute or the number of seconds specified by the
X.B -T
Xoption on the command line.
X.PP
XIf you are using your system mailbox as your \*Qcurrent folder,\*U then the
Xnew mail is added immediately to your current
Xlist of messages and information similar to the following example is
Xdisplayed, to tell you whom the mail is from:
X.sp
X.ti +2
XNew mail: (#15) argv@zipcode.com (Dan Heller)
X.sp
XIf you are not in your system mailbox, then the new mail will not be added
Xto your list of messages, but you will instead be informed of the new arrival.
X.sp
XIf you are using the tool based mode and
X.I Mush
Xis closed to an iconic state, then the number of messages in the current
Xfolder is displayed on the mailbox icon and the flag on the mailbox will go up.
X.PP
X.IR "Displaying messages" .
X.PP
XDepending on the interface you use, you can display any message in your
Xlist of messages as long as the message is not marked for deletion.
XIf the message is marked as deleted, then use the 
X.B undelete
Xcommand supplied by the interface you are using.
XTo display a message in line mode, specify the message using
X.BR print ,
X.BR type ,
X.BR p ,
X.BR t ,
Xor type a message number to display that message on the screen.
X.PP
XIn curses mode, move the cursor over the message you want and type
Xa `t' or `p' to read the message.
XYou may \*Qbind\*U other keys to call
Xthe function that displays messages if `t' and `p' are uncomfortable.
X.PP
XIn the tool mode, move the cursor over the header summary of the
Xmessage you wish to be displayed and select the LEFT mouse button.
XThe MIDDLE mouse button will delete the message, and the RIGHT button
Xwill bring up a menu of additional options, including help.
XIf the message you want is not visible (in the header subwindow), you may type
Xthe number of the message in the \*QRange:\*U item, and press return.
XThat message number will be displayed.
XFinally, the \*QNext\*U item in the panel below the header display
Xcan be used to step through the folder, one message at a time.
X.PP
XIn the line or curses mode, if the message has more lines than the variable
X.BR crt ,
Xthen a
X.I pager
Xwill be invoked to allow the user to page through the message without
Xhaving it scroll off the screen.
XThe pager used is determined by the variable
X.BR pager .
XIf that variable is unset, then a default pager will be used.
XNote that if pager is set, but not to a value, or is set to the value
Xof \*Qinternal\*U, then the internal pager is used.
XThe internal pager
Xis very simple; the spacebar displays the next
X.B crt
Xlines, carriage return prints the next line, and \*Qq\*U quits the pager.
X.PP
XIn the tool mode, if a message is larger than the size of the message
Xsubwindow, the scrollbar at the left side of the window may be used to
Xpage the message forwards and backwards.
XThe variable
X.B crt_win
Xmay be set in an initialization file to preset the size of the
Xmessage display subwindow.
X.PP
XAn alternative to displaying messages is the
X.B top
Xcommand.
XThis command will print just the top few lines of a message.
XThe number of lines is determined by the variable
X.BR toplines .
XIf this variable isn't set,
X.B top
Xwill print a number of lines equal to the value of the variable
X.BR crt .
X.PP
X.IR "Sorting mail" .
X.PP
X.I Mush
Xallows you to sort your mail according to various constraints such
Xas time, size, status (new, unread, deleted, etc.), author and subject.
XSee the
X.B sort
Xcommand in the COMMANDS section for more information on sorting.
XSorting has a panel item in the tool mode, and is bound by default
Xto the `o' (sort) and `O' (sort reverse) keys in curses mode.
X.PP
X.IR "Picking specific messages" .
X.PP
XYou can select messages that contain unique information, or from
Xmessages that have special attributes.
XYou have the option of restricting your search to messages between dates,
Xmessage numbers, author names and other constraints.
XSee the
X.B pick
Xcommand in the COMMANDS section for complete details.
XThis feature is not directly accessible from the tool mode, and is
Xavailable only as a search action in curses mode (see, however, the
XCURSES INTERFACE section for temporary escapes to line mode).
X.PP
X.IR "Sending mail" .
X.PP
XYou can send mail by listing addresses on the command line when
X.I Mush
Xis started, by using the
X.B mail
Xcommand from within
X.IR Mush ,
Xor by responding to other mail.
XIn curses mode, the `m' key invokes mail, and the `r' key begins a response.
XIn the tool mode, selecting the \*QCompose\*U or \*QReply\*U items on the main
Xpanel will open a separate frame for message composition.
XThe message replied-to is either the current message or one specified in
Xthe \*QRange:\*U item.
X.PP
XWhen you are sending mail, you are in a mode where everything
Xyou type is added to the contents of the message.
XWhen you are done typing your message in line or curses modes,
Xyou can type `^D' (control-D) to signify the end of the message.
XIf you have the variable
X.B dot
Xset, then you can end a message with a `.' on a line by itself.
XIn the tool mode, select the \*QSend\*U item in the composition frame
Xto finish and send the message.
X.PP
XWhile you are composing a message,
X.I Mush
Xtreats lines beginning with the character `~' specially.
XThis is called a
X.BR "tilde escape" .
XFor instance, typing \*Q~i\*U (alone on a line) will place a copy
Xof the \*Qcurrent message\*U into your message body.
XIt will not include the message headers of the message, just the body of text
Xthat comprises the message.
XA subset of these escapes are available in the tool mode, and others are
Xprovided as panel items or as menu selections from the \*QInclude\*U item.
XTilde escapes which alter message headers are not usable when the variable
X.B edit_hdrs
Xis set or when the \-E option was passed to the
X.B mail
Xcommand.
X.PP
XThe tool mode composition window uses header editing at all times, but
Xprovides some of these escapes anyway; see the descriptions below, and the
Xdescription of the
X.B edit_hdrs
Xvariable, for complete details.
X.PP
XAvailable
X.BR "tilde escapes" :
X[OPTIONAL arguments in square brackets]
X.TP
X~a file
XAppend message buffer to file name.
XAccessed via the \*QExport\*U panel item in tool mode.
X.TP
X~b [bcc-list]
XModify blind carbon recipients; otherwise identical to ~t.
XIn tool mode, moves the cursor to the Bcc: header, adding one if necessary.
X.TP
X~c [cc-list]
XModify carbon copy recipients; otherwise identical to ~t.
XIn tool mode, moves the cursor to the Cc: header, adding one if necessary.
X.TP
X~E[!]
XErase message buffer; not available in tool mode.
XSaves the contents of the letter to \*Qdead.letter\*U
X(unless the `!' is specified) and then clears the message buffer; the user
Xremains in editing mode.
XIf the variable
X.B nosave
Xis set, then `!' need not be specified.
X.TP
X~e [editor]
XEnter the editor.
XDefaults to variable
X.BR editor ,
Xenvironment EDITOR, or
X.IR vi ,
Xexcept in tool mode, where ~e is equivalent to ~v.
X.TP
X~F[!]
XAdd a fortune [don't add] at end of message.
XAccessed via the \*QFortune\*U panel item in tool mode.
X.TP
X~f [msg-list]
XForward mail.
XThe included messages are not indented,
Xbut are marked as \*Qforwarded mail\*U.
XAccessed via the \*QInclude\*U panel item in tool mode.
X.TP
X~h
XModify all message headers.
XEach header is displayed one by one and each may be edited.
XIn tool mode, moves to the To: header; typing a carriage return will
Xadvance the input cursor to each of the other headers in turn.
XThe mouse cursor will change to a \*Qbent arrow\*U when automatic
Xinput cursor advance is active.
X.TP
X~I [msg-list]
XSame as ~i, but also include the message headers.
XAccessed via the \*QInclude\*U panel item in tool mode.
X.TP
X~i [msg-list]
XInclude the body of the current message (or listed messages).
XAccessed via the \*QInclude\*U panel item in tool mode.
XSee the descriptions of the variables
X.BR indent_str ,
X.BR pre_indent_str ,
Xand
X.BR post_indent_str .
X.TP
X~p [pager]
XPage the message body; not available in tool mode.
XDefaults to variable
X.BR pager ,
Xenvironment PAGER, or the default pager set up by the system administrator.
XThis may be the internal pager.
X.TP
X~q
XQuit message; save in ~/dead.letter if
X.B nosave
Xis not set.
XNot available in tool mode.
X.TP
X~r file
XRead filename into message buffer.
XAccessed via the \*QImport\*U panel item in tool mode.
X.TP
X~S[!]
XInclude [don't include] signature at end of message.
XThe variables
X.B autosign
Xand
X.B autosign2
Xdescribe the file or string to append to the message.
XSee the VARIABLES section for more information on these variables.
XAccessed via the \*QAutosign\*U panel item in tool mode.
X.TP
X~s [subject]
XModify the subject header.
XIn tool mode, moves to the Subject: header, adding one if necessary.
XIn other modes,
Xif an argument is given (a new subject), then the subject line is
X.I replaced
Xby the new subject line.
XIf none is given, then the subject line is
Xdisplayed for editing just as in the ~t command.
X.TP
X~t [list]
XChange list of recipients (\*QTo\*U list).
XIn tool mode, moves the cursor to the To: header.
XIn other modes,
Xif a list is given, this list is
X.B appended
Xto the current list.
XIf no list is given, then the current list
Xis displayed and the cursor placed at the end of the list.
XYou can backspace over the stuff in the list or you can append more
Xaddresses onto the end of the list as desired.
X.TP
X~u
XUp one line; not available in tool mode.
XIf the user made a mistake typing a letter and he
Xhas already hit carriage return, he may avoid entering the editor
Xand edit the previous line using ~u.
XThe line is retyped and
Xthe cursor is placed at the end allowing the user to backspace
Xover it and retype the line.
XSystem-V users should note that if
Xthe new line is shorter than it was before the ~u command, the
Xline is padded with blanks to the previous length of the file.
X.TP
X~v [editor]
XEnter the visual editor; works in tool mode.
XAlso accessible through the \*QEdit\*U button in tool mode.
XDefaults to variable
X.BR visual ,
Xenvironment VISUAL, or
X.IR vi .
X.TP
X~w file
XWrite message buffer to the indicated file.
XAccessible in tool mode via the \*QExport\*U panel item.
XWhen the header editing is in use (the variable
X.B edit_hdrs
Xor the \-E option of
X.BR mail ),
Xthis tilde-command can be used to create a \fIdraft file\fR.
XDraft files are partially completed letters that you wish to save for
Xediting and eventually sending later.
XSee the
X.B mail
Xcommand for a description of rereading and sending drafts.
X.TP
X~x
XExit message; don't save in dead.letter.
XAccessible in tool mode via the \*QAbort\*U panel item.
X.TP
X~$variable
XInsert the string value for variable into message; not available in tool mode.
XIf a boolean variable is listed, nothing is appended regardless of its value.
X.TP
X~:command
XRun the
X.I Mush
Xcommand specified by \*Qcommand\*U; not available in tool mode.
XYou may not run any command that sends mail.
XIt is inadvisable to change folders at this time
Xsince the current message list may be corrupted, but the action is
Xallowed nonetheless to provide flexibility for experienced users.
X.TP
X~~
XA line beginning with two escape characters will be unaffected by
X.I Mush
Xexcept that only a single tilde will be inserted into the letter.
X.PP
XThe variable
X.B escape
Xmay be set to describe a character other than `~' to be used as the
Xescape character.
XHowever,
X.I "tilde escapes are normally NOT interpreted when"
XMush
X.IR "is started with redirected input" .
XIf tilde-interpretation is desired, use the \-i option when starting
X.IR mush .
X.PP
X.IR "Mail Aliases" .
X.PP
XMail aliases are shorthand names for long mail addresses.
XThese are supported in the same manner as UCB Mail supports them.
XBecause
X.I Mush
Xhas command line history reminiscent of
X.IR csh ,
Xcommands that use UUCP's `!' character for user-host and host-host
Xseparation should be escaped (preceded by a backslash).
XThis is not necessary in the initialization file (.mushrc) because history
Xreferencing is ignored while these files are being sourced.
XSee the INITIALIZATION and LINE-MODE INTERFACE sections for more
Xinformation on initialization file format and the history mechanism.
X.PP
XAliases reference normal mailing addresses as well as other aliases.
XIf a loop is detected, then the user will be notified and the message will
Xbe forced into the file
X.B dead.letter
Xin the user's home directory.
XThe
X.B unalias
Xcommand is used to reverse the effects of the
X.B alias
Xcommand.
XFrom the tool mode, aliases can be set and unset in an
X.IR "aliases subwindow" .
XPress the RIGHT mouse button on the \*QOptions\*U item in the main
Xframe, and select \*QAliases\*U from the menu.
X.PP
X.IR Help .
X.PP
X.I Mush
Xwas designed so that each command or action should not be a mystery.
XHelping the user understand what to do and how to do whatever he wishes
Xis the goal behind the help facility.
XFor this reason, the
X.B help
Xcommand gives information on both general usage and a few specific help
Xcategories.
X.PP
XIn text mode, most help is gotten by typing \-? as an argument to a
Xcommand.
XAlmost every command has the \-? option.
XWhen this option is specified, most commands will attempt to read from
Xa help file a brief explanation of the functionality of the command.
XIf necessary, a pointer to other sources of information will
Xbe given to fully explain a concept.
X.PP
XIn line mode, typing `?' as a command will display a list of possible commands.
XIn the curses mode, the `?' key will display help message, which explains
Xhow to obtain a list of the current key-to-command bindings; a keystroke
Xor set of keystrokes correspond directly to a command.
X.PP
XIn the tool mode, this is
Xalso available, but more extensive help is provided in the pop-up menus.
XPress the RIGHT mouse button (the \*Qmenu button\*U) when pointing to any
Xpanel button and a number of items will appear in a menu.
XThe last command in the menu list will often be one labelled \*Qhelp\*U.
XIf a button does not have a menu or has no help item, check the
Xmenu of the \*QHelp\*U button for related topics.
XSelecting any help item will open a new scrollable window with help text.
X.I "Note:  The limited number of file descriptors in SunOS 3.5 forces"
XMush
X.I "to display help information in the"
X.IR "message window in the main frame" .
X.\" Some nroffs can't handle long .IR arguments
X.SH INITIALIZATION
XAfter the command line arguments have been interpreted
X.I Mush
Xwill read commands from one or more
X.B "initialization files"
Xthat (typically) set variable values, aliases, command line aliases,
Xand so forth.
XAny file specified by the \-I option is read first.
XNext, if neither \-I! nor \-n was given, a default system initialization
Xfile is read.
XThe system default file
Xis set up by the system administrator and may contain commands that
Xshould be set system-wide.
XFinally, if \-n! was not given,
X.I Mush
Xreads the user's personal initialization file.
X.PP
XThe user's file is determined by first looking for the environment variables
X.I MUSHRC
Xor
X.IR MAILRC .
XIf neither of those environment variables is set, then the file
X.I .mushrc
Xis searched for in the home directory of the user.
XIf that file cannot be found,
X.I Mush
Xwill attempt to read the file
X.I .mailrc
Xfrom the same directory.
XFinally, if that file cannot be read, no initialization is done
Xand the default values will be in effect.
X.PP
XIf the user has no home directory, or permissions prevent read/write access
Xto $HOME, /tmp is used as the home directory.
XSee the
X.B home
Xvariable under the VARIABLES section.
X.PP
XOnce in the shell, the
X.B source
Xcommand may be used to specify a file if you want to read commands
Xfrom a file other than the default.
XThe command
X.B saveopts
Xwill save all variable settings, aliases, and all other
X.I Mush
Xsettable attributes, to aid in creating an initialization file.
XIf no filename is given on the command line,
Xthe
X.B source
Xand
X.B saveopts
Xcommands choose a file in the manner described above.
X.B Saveopts
Xwill not overwrite the file if it exists.
XIn such cases, you will be prompted to confirm overwrite.
XIf you confirm overwriting the existing file, remember that existing \*Qif\*U
Xexpressions or other manually entered comments or non variable-setting type
Xcommands that previously existed in the file will be lost.
X.PP
XNo interactive commands should be called from any initialization file.
XThese commands are not prevented because it is impossible to trace which
Xcommands are actually
X.IR UNIX (TM)
Xcommands that will be interactive.
XThe responsibility of not running interactive commands is left to the user.
XBecause the initialization file is read
X.I before
Xany messages are read into the program,
Xmessage filtering commands should not be placed in this file unless you know
Xyou're going to
X.IB re- source
Xthe file later as a command.
X.PP
X.IR "Initialization File Format" .
XWhen reading the initialization file,
X.I Mush
Xwill recognize the `#' character as a comment character.
XIt may be anywhere on a line in the file.
XWhen that character is encountered,
Xprocessing of that line is discontinued to the end of the line.
XIf the `#' is enclosed in quotes (single or double), then it is not
Xconsidered a comment.
XExamples:
X.sp
X.ti +2
Xset shell = /bin/csh  # set the shell variable
X.ti +2
X# this entire line has been commented out.
X.ti +2
Xset prompt = "Message #%m: "  # The `#' is within quotes
X.PP
XThe
X.B exit
Xcommand has special meaning in the initialization file.
XIf the command is found,
X.I Mush
Xwill not exit, but rather, discontinue reading from the file immediately.
X.PP
XThere may be \*Qif\*U expressions within the initialization file to determine
Xcertain runtime states of
X.IR Mush .
XNo parentheses are allowed and only one boolean expression may be
Xevaluated per line; that is, no \*Q&&\*U or \*Q|\||\*U may be used in
Xexpressions.
XAn \*Qelse\*U on a line by itself may precede alternative
Xactions.
X\&\*QIf\*U expressions may be nested to any reasonable depth, but
Xthere must always be an \*Qendif\*U matching each \*Qif\*U expression.
XThe statements associated with an \*Qif\*U expression are never on the
Xsame line with the conditional expression.
X.PP
XConditional expressions understood include the internal variables
X.IR istool ,
X.IR iscurses ,
X.IR is_shell ,
X.IR hdrs_only ,
X.IR is_sending ,
Xand
X.IR redirect .
XThese are internal variables whose values cannot be referenced using the
X\*Q$variable\*U method of variable expansion.
XIf
X.I istool
Xis true, the program is going to run in the tool mode.
XIf
X.I iscurses
Xis true, the program is in or is going to run in the curses mode even
Xthough the screen package may not yet have been started.
XIf
X.I is_shell
Xis true, then
X.I Mush
Xhas entered the shell;
X.I is_shell
Xis always false at startup when initialization files are read,
Xand is always true when files are sourced after initialization with the
X.B source
Xcommand or the \-F option.
X.PP
XIf
X.I hdrs_only
Xis true, then the -H flag on the command line has been given.
XIf
X.I is_sending
Xis true, then the user is sending mail to another user.
XThis does not imply
Xthat the user is not going to be running a shell after the mail is sent.
XIf
X.I redirect
Xis true, then input to the program is redirected.
XThe test for redirection tells whether input, not output, has been
Xredirected to the program.
XThe
X.B \-i
Xoption on the command line is required to run the shell if redirect is on.
XIf \-i is specified, the value for
X.I redirect
Xwill be set to false.
XNote that any time
X.I Mush
Xruns when not connected to a terminal, it will
Xbelieve that input has been redirected.
XSee the MUSH SCRIPTS section for more details.
X.PP
XThe `!' operator may be used to negate expressions, thus,
X.sp
X.nf
X.in +2
Xif !istool
X.ti +4
Xexit
Xelse
X.ti +4
Xset autoprint
Xendif
X.in -2
X.fi
X.sp
Xmeans that if you are not running as a tool, stop reading commands from this
Xfile.
XOtherwise, set the autoprint variable.
X.sp
X.in +2
X.nf
Xset hdr_format = "%25f %7d (%l/%c) %25s"
Xif hdrs_only
X.ti +4
Xexit
Xendif
X.in -2
X.fi
X.sp
XThis tells the program to set the hdr_format variable and check to see if
Xwe're running the program to read headers only.
XIf so, stop reading this file (exit) and continue on with the program.
XThis speeds up runtime quite a bit for those who have lengthy initialization
Xfiles, because no other shell variables are necessary.
X.sp
X.in +2
X.nf
Xif !iscurses
X.ti +4
Xset crt = 24 screen = 18
Xendif
X.in -2
X.fi
X.sp
XThis segment checks to see that we're not running in curses mode, and if not
Xit will set our crt and screen sizes.
XThis is mostly because the curses mode will set those values for us by looking
Xat the size of the screen.
XSee the CURSES INTERFACE section for configuring your
Xenvironment so you enter curses mode each time you run the shell.
X.PP
XString evaluation is allowed in \*Qif\*U expressions, and the operators
X\*Q==\*U and \*Q!=\*U may be used to determine equality or inequality,
Xand \*Q=~\*U and \*Q!~\*U may be used for pattern-matching.
XUsually, variables are compared with constants for evaluation.
X.PP
XNote that it is not possible to compare variables to an empty string, and
Xvariables that evaluate to an empty string may cause errors.
XIt is possible to test whether a variable is set by using the syntax
X\*Q$?variable\*U (as in
X.IR csh )
Xbut there is not currently any way to test for an empty string value.
X.sp
X.in +2
X.nf
Xif $TERM == adm3a
X.ti +4
Xset pager = more
Xelse
X.ti +4
Xset pager = less
Xendif
X.in -2
X.fi
X.sp
XThis segment tests to see if the user's terminal type is \*Qadm3a\*U.
XIf it is, then it sets the pager variable to be the 
X.I more
Xprogram.
XNote that the variable TERM will be gotten from the user's environment if a
Xshell variable is not set already.
XOtherwise, the pager variable is set to \*Qless\*U.
XThis exemplifies the fact that
X.I less
Xfrequently fails to function correctly
Xfor the terminal type \*Qadm3a\*U so we don't use it.
X.sp
XAlso supported in \*Qif\*U expressions are the test flags \*Q-e\*U
Xand \*Q-z\*U.  These flags test to see if a file exists (\*Q-e\*U) or
Xif it is zero-length (\*Q-z\*U).
XThese are most useful in command files that are to be read after the
Xshell has started; see the examples in the MUSH SCRIPTS section.
X.PP
XAfter sourcing the initialization file,
X.I Mush
Xreads all the mail out of the specified folder (the system spool directory
Xif no folder is given) and creates a list of messages.
XThe current maximum number of messages the user
Xcan load is set to 1000 by default.
XThe system administrator who configures the program can reset this
Xvalue higher or lower if you ask nicely.
XIf the user has the
X.B sort
Xvariable set, then when the current folder's messages have all been read,
Xthe messages are sorted according to the value of the
Xvariable (see the
X.B sort
Xentry under the VARIABLES heading for more information).
XEach message has a number of message header lines that contain information
Xabout whom the mail is from, the subject of the message, the date it was
Xreceived, and other information about the letter.
XThis information is then compiled into a one-line summary for
Xeach message and is printed out in an appropriate manner
Xdepending on the interface you're using.
X.PP
XAt this point, commands may be input by the user.
XLengthy or complex commands can be placed in a file and then executed via the
X.B source
Xcommand.
XSuch files use the same format as the initialization files and may use all
Xthe same tests in \*Qif\*U expressions.
XSourcing of a file of filter commands such as those in the example above
Xcan be automated by using the \-F option when \fIMush\fR is started.
XAlso see the MUSH SCRIPTS section for other uses.
X.SH "LINE-MODE INTERFACE"
XIn the line-mode, the user is given a prompt to which commands are issued
Xand arguments are passed to commands.
XWhen the user types at the prompt, each line is parsed and words (or
Xarguments) are separated into an array of strings.
XThis array, also called an
X.IR "argument vector" ,
Xis then modified by expanding history references, command line aliases,
Xand variable references.
XA command line ends when the end of the line is encountered or a pipe (|)
Xor semicolon (;) character is encountered, separating discrete commands.
X.PP
XWhen a command line has been parsed and placed in an argument vector, the
Xfirst argument in the vector (the \*Qcommand\*U) is searched for in a list
Xof legal
X.I Mush
Xcommands.
XIf found, the function associated with that command is called and
Xthe rest of the line is passed to that function as
X.IR "command line arguments" .
X.PP
XBefore commands are called, however, the input the user gives is preprocessed
Xin a style reminiscent of the C-shell
X.RI ( csh ).
X.I Mush
Xalso supports a subset from each of the following aspects of
X.IR csh :
X.in +2
X\(bu Command history.
X.br
X\(bu Command line aliasing.
X.br
X\(bu \*QPiping\*U mechanism to
Xredirect \*Qinput\*U and \*Qoutput\*U of commands.
X.br
X\(bu Filename metacharacters.
X.in -2
X.PP
X.BR "Command history" .
X.PP
X.I Mush
Xsupports a history mechanism similar to that supplied by
X.IR csh .
XA subset of
X.I csh
Xhistory modifiers are supported to reference previously
Xissued commands and to extract specified arguments from these commands.
X.PP
XThe history mechanism remembers a list of past commands whose length is
Xbounded by the value of the
X.B history
Xvariable.
XIf this variable is not set, only the most recent command is remembered.
XTo reference previously typed commands, the `!' character
Xis used in the same manner as in
X.IR csh .
XThere is a limited implementation of history modification;
Xsupported are the argument selectors that reference
Xcommand line arguments and \*Q:p\*U (echo, but don't execute the command).
X.sp
XExamples:
X.nf
X.in +2
X.ta 1i
X!-2:$	two commands ago, last argument.
X!3:2-4	the third command, arguments two through four.
X!!:p	print the last command in its entirety.
X.in -2
X.fi
X.PP
XDuring the sourcing of initialization files (.mushrc), history is not
Xin effect and therefore the `!' character does not cause history expansion.
XThis includes startup of the program and when the command
X.I source
Xis issued.
XUUCP style addresses that contain the `!' character may be given in the
Xinitialization file without the need to be preceded by a backslash.
XHowever, `!' does need to be escaped if
X.BR cmd 's
Xare used to reference command line arguments.
X.PP
X.BR "Command line aliasing" .
X.PP
XCommand aliases are different from mail aliases in that they are used
Xto expand to commands.
XThis feature enables command substitution similar to
X.IR csh .
XTo be backwards compatible with UCB Mail, the
X.B alias
Xcommand is used for address aliasing.
XThus, the command
X.B cmd
Xis introduced in place of
X.BR alias .
X.PP
XExamples:
X.nf
X.in +2
Xcmd d delete
Xcmd t type
Xcmd dt 'd ; t'
Xcmd - previous
Xcmd r 'reply \\!* -e -i'
X.in -2
X.fi
X.sp
XIn the last example, if the user types \*Qr 5\*U,
X.I Mush
Xwill reply to sender of the fifth message and pass all the other
Xarguments along to the
X.B reply
Xcommand.
XNote the escaping of the `!' character.
XThis must also be done if set in the initialization file (.mushrc).
XHad the user not specified a message number on the `r' command line,
X.B reply
Xwould respond to the \*Qcurrent message\*U rather than the fifth message.
X.PP
X.BR "Piping commands" .
X.PP
X.I Mush
Xcommands can be \*Qpiped\*U to one another so as to provide output of
Xone command to be used as input to the next command in the pipeline.
XHowever, the output of commands is not the \*Qtext\*U that is returned
X(as it is in
X.I sh
Xand
X.IR csh ),
Xbut instead is a
X.B "message list"
Xof the messages that were affected.  A
X.B "message list"
Xis defined as the set of messages that the user specifies in a command or
Xthe messages a command affects after it is through executing.
XWhen one command is piped to another, the effect is that the second command
Xwill consider only those messages affected by the first command.
XIn most cases,
X.I Mush
Xis smart enough to know when piping is occurring and may suppress text output
Xthat a command might produce.
X.PP
XExamples:
X.sp
X.ti +2
Xpick -f fred | save fred_mail
X.sp
XThis will find all the messages from \*Qfred\*U
Xand save them all in the file named fred_mail.
X.sp
X.ti +2
Xlpr 4-8 | delete
X.sp
XThis will send messages 4, 5, 6, 7, and 8 to the printer and then delete them.
X.sp
X.ti +2
Xheaders :o | delete
X.sp
XDeletes all old (already read) mail.
X.PP
XBecause action is taken on mail messages, not files,
Xmetacharacters such as `*' and `?' are not expanded to file names as
X.I csh
Xwould do.
XInstead,
X.I Mush
Xcommands take
X.I "message lists"
Xas arguments (a list references one or messages) to take action upon.
XWhen referencing message numbers,
X.I Mush
Xunderstands the following special syntax:
X.sp
X.in +2
X.nf
X.ta 1.0i
X*	All messages
X^	The first message
X$	The last message
X\&.	The current message
XN\-M	A range of messages between N and M, inclusive
X.sp
X.fi
X.in -2
XIn the last case, N and M may be * ^ $ . or digits referencing
Xexplicit message numbers.
XThe range must be in ascending order.
X.sp
XYou can also negate messages by placing the message list inside
Xbraces, `{' `}' \*- thus, the expression \*Q2-19 {11-14}\*U references
Xmessages 2 through 19 except for messages 11 through 14.
X.sp
XNote that message lists are parsed left to right.
XNegated messages may be reset by turning them on
Xagain later in the argument list.
XA common error new users make is to specify a negated list without
Xspecifying any beginning messages.
X.sp
X.ti +2
Xdelete { 6 }
X.sp
XIn this example, the user attempted to delete all messages
Xexcept for number 6.
XHe should have specified `*' beforehand.
XA correct example:
X.sp
X.ti +2
Xpreserve ^-. { 3 }
X.sp
XHere, the user specifies a valid message list and causes
X.I Mush
Xto preserve all messages from the beginning of the list (message 1)
Xto the current message, excluding message 3.
X.PP
XAs discussed, after the command line is parsed, the command given is
Xcalled and the rest of the arguments on the command line are passed to it.
XIf no
X.I Mush
Xcommand has been found that matches the one given, then the variable
X.B unix
Xis checked.
XIf it is set,
X.I Mush
Xattempts to run the command line as a
X.IR UNIX (TM)
Xcommand.
X.PP
XIf
X.B unix
Xis not set, or if the command could not be found in the user's PATH
Xenvironment, a message will be printed indicating that the command was
Xnot found.
X.PP
XSince no \*Qmessages\*U are affected by \fIUNIX\fR
Xcommands, those that appear within \fIMush\fR
Xpipelines are executed by the \fBpipe\fR command.
XA \fIUNIX\fR command may never be the first command in a pipeline
Xunless the \fBpipe\fR command is used explicitly.
XIf the user wishes to execute \fIUNIX\fR
Xcommands that are to be piped to one another (or use any sort of redirection),
Xthe command \fBsh\fR is provided for such purposes.
XSince \fIMush\fR will parse the entire command line, caution should be
Xtaken to enclose questionable shell variables or metacharacters with
Xquotes to prevent \fIMush\fR from expanding them.
XSee the COMMANDS heading below for more detail.
X.PP
XThis shell-like quality is for the convenience of the user and is not
Xintended to replace the functionality of
X.IR sh ,
X.IR csh ,
Xor any other command interpreter.
X.PP
X.BR "Filename metacharacters" .
X.PP
X.IR Mush "'s"
Xcommand interpreter does not normally pre-expand metacharacters in the
Xmanner of other shells, because the metacharacters may refer to either
Xmessages or files.
XInstead, those commands that deal with file names do any necessary
Xmetacharacter expansion.
XTwo metacharacters are nearly always recognized:  `~' refers to the user's
Xhome directory, and `+' refers to the user's folder directory (\*Q~/Mail\*U
Xor the value of the variable
X.BR folder ).
XAnother user's home directory can also be referenced as \*Q~username\*U,
Xand for this reason files in the user's home directory must be referenced
Xas \*Q~/filename\*U.
XHowever, the `/' character is optional when referring to folders;
Xthat is, \*Q+filename\*U and \*Q+/filename\*U both refer
Xto the same file in the folder directory.
X.PP
XIf filename completion is enabled by setting the variable
X.BR complete ,
Xthe command interpreter will expand
X.IR csh -style
Xmetacharacters when completing filenames.
XA completion containing metacharacters expands to all the files matching
Xthe pattern when the completion key is pressed (defaults to ESC, `^[').
XSee the description of
X.B complete
Xfor limitations of this facility.
X.SH "CURSES INTERFACE"
XThe curses interface utilizes the curses routines intrinsic to most
X.I UNIX
Xsystems.
XThis interface is screen oriented rather
Xthan line oriented and allows the user to access commands and messages
Xmore quickly at the cost of history, piping, and a few commands.
X.PP
XMany users who prefer the curses interface might want to always start
Xall their mail sessions in the curses interface.
XPutting the
X.B curses
Xcommand in your initialization file is allowed, but you can also create
Xan alias or function in your login shell to always use the -C option.
X.I Mush
Xwill attempt to know not to run a shell if you're just sending mail to
Xsomeone, so the
X.I csh
Xcommand sequences:
X.sp
X.ti +2
X% alias mail 'mush -C'
X.ti +2
X% mail fred
X.sp
Xwill mail to fred and not enter the shell.
XHowever, if you just said \*Qmail\*U
Xwith no arguments, you'll enter the shell in curses mode if you have mail.
XIf you don't, you'll be told so, and the shell will not start.
XIf you want to enter curses mode even if
Xyou don't have mail, use the \-S option on the command line.
X.PP
XIn curses mode, the user's terminal has its \*Qecho\*U turned off so commands
Xthat are issued are not echoed on the screen.
XCertain commands cause the mode
Xto return to normal for typing purposes (sending mail, for example).
XIn normal operation, the screen will display the current set of message
Xheaders, the current message number is in the top left corner, the
Xmail status on the top line, and the cursor will be placed on the current
Xmessage.
XThe number of message headers displayed is set by the variable
X.BR screen .
XIf the user does not have that variable set, the baud rate is checked and
Xthe size of the screen is set according to optimal refresh time.
XUsually, 300 baud gives 7 lines, 1200 gives 14, 2400 gives 22 lines, and all
Xhigher baud rates give the size of the screen, whatever that may be.
XNote that the top line is reserved for \*Qstatus\*U and the bottom line is
Xfor user interaction should it be required.
X.PP
XThe user may now type commands via key sequences that are not echoed
Xto the screen.
XThus, function keys may be bound to \*Qcommands\*U by using the 
X.B bind
Xcommand.
XA list of key-to-command bindings can be found at runtime by typing `?'
Xin curses mode or by using the
X.B bind
Xcommand in line mode.
X.PP
XThe commands to which you can map sequences are intended to be as self
Xexplanatory as possible, but admittedly, it might be easier to figure out
Xvia trial and error than to try to wade through this documentation.
XA list of the legal curses commands can be obtained when executing the
Xbind command.
XRegular tty line-mode commands are not issued from
Xthe curses interface; only special curses mode commands are understood.
XThe current list of valid curses commands is:
X.sp
X.ta 2i 4i
X.in +4
X.nf
Xalias	last-msg	screen-back	
Xback-msg	line-mode	screen-next	
Xbind	lpr	search-again	
Xbind-macro	mail	search-back	
Xbottom-page	mail-flags	search-next	
Xchdir	map	shell-escape	
Xcopy	map!	sort	
Xcopy-list	my-hdrs	sort-reverse	
Xdelete	next-msg	source	
Xdelete-list	preserve	top	
Xdisplay	quit	top-page	
Xdisplay-next	quit!	unbind	
Xexit	redraw	undelete	
Xexit!	reply	undelete-list	
Xfirst-msg	reply-all	update	
Xfolder	reverse-video	variable	
Xgoto-msg	save	version	
Xhelp	save-list	write	
Xignore	saveopts	write-list	
X.fi
X.in -4
X.sp
X.PP
XThe following is a list of default key-command bindings.
XIf you specify bind commands in your initialization file that conflict with
Xthese defaults, your settings will override the defaults.
XThe default settings given in this manual
Xuse the ^-character method to indicate control characters
X(mostly because nroff makes printing the backslash
Xcharacter so amazingly difficult).
XThus, `^X' would mean control-X even
Xthough you'd have to type \*Q\\CX\*U to set
Xthe binding and actually use the control key and the `X' key simultaneously
Xto really
X.I do
Xa Control-X.
X.TP
X\&., t, p, T=top, n=next
XDisplay (type/print) message.
XTop will display the first
X.B crt
Xlines of a message.
XNext will print the next message.
XIf the current message is deleted, the next undeleted message is found.
XYou might notice this is different from the line mode, which will return
Xan error message that the current message is marked as deleted.
X.TP
X+, j, J, RETURN
XGo to next message.
X.TP
X-, k, K, ^K
XGo to previous message.
X.TP
X^, $
XGo to first/last message.
X.TP
X{, }
XGo to top/bottom of screen.
X.TP
Xa
XSet aliases.
X.TP
Xb, B
XSet/unset bindings.
X.TP
Xd, D, u, U
XDelete/undelete messages (capitals prompt for message list).
X.TP
Xf
XChange folder.
XIf current folder has changed, verification for update will be requested.
X.TP
Xg, 0-9
XGo directly to a specified message.
XWhen the \*Qgoto\*U command
Xis selected, a prompt at the bottom of the window prompts for a
X.BR "message list" .
XAnything that describes a message list may be used.
XSince
X.I Mush
Xcommands return message lists, a legal
X.I Mush
Xcommand enclosed in backquotes may be used to go to a particular message.
XThe new current message pointer will point to the next
Xmessage, returned by the command, that is below the old current message.
XAn example:
X.sp
X.ti +2
Xgoto msg: `pick \-f argv`
X.sp
XThis will cause the current message to move to the first message
Xin the current folder from the user \*Qargv\*U that comes after the
Xmessage pointed to when the \*Qgoto\*U was issued.
XSo, if messages 1 and 5
Xare from the user \*Qargv\*U and the current message the user was on
Xwas message 3, then the new current message would be message 5, since it
Xis the first message found after message 3 that is from \*Qargv\*U.
XIf none of the messages are found after the current message, the new
Xcurrent message will be the first one returned by the command.
X.TP
Xh
XSet personal headers.
X.TP
Xi
XSet ignored headers.
X.TP
Xm, M
XSend mail (capital prompts for mail flags).
X.TP
Xo, O
XOrder messages (sort; capital reverses order).
XA prompt requests the sort constraints.
X.TP
Xq, Q, x, X
XQuit/exit.
X\&`q' will test to see if the current folder has been updated and prompt
Xthe user to verify updating.
X\&`x' does not update mail, but quits the program.
X\&`Q' does not prompt for update verification; if changes were
Xmade, updating is automatic.
X\&`Q' (quit!) and `X' (exit!) will work even when typed at the
X\*Q...continue...\*U prompt, whereas `q' and `x' will not.
X.TP
Xr, R
XReply/reply all.
X.TP
Xs, S, c, C, w, W
XSave, copy, or write messages (capitals prompt for message lists).
X.TP
Xv
XSet regular variables (as opposed to environment variables).
X.TP
XV
XPrint version number.
X.TP
Xz, Z
XPrint next/previous screenful of message headers.
X.TP
X^L
XRedraw the screen.
X.TP
X^P
XPreserve current message (toggle).
X.TP
X^U
XUpdate folder.
XA prompt will request confirmation.
X.TP
X^R
XToggle reverse video mode (current message is in reverse video).
X.TP
X|
XSend message to printer
X.TP
X!
XShell Escape.
XPrompts for command; RETURN invokes a shell.
X.TP
X%
Xchange directory.
X.TP
X(, )
XSource/saveopts.
XPrompts for file name.
X.TP
X/, ^/, ^N
XForward, backward, continue search for patterns.
XEntire messages are not searched for here.
XOnly the text available on the screen is searched for.
XNote that some terminals use `^_' (control-underscore) for `^/',
Xso you may wish to re-bind this key.
X.TP
X&&
XCreate a curses mode macro.
X.TP
X&:
XCreate a line mode macro.
X.TP
X&!
XCreate a composition mode macro.
X.TP
X:[cmd]
XEnter line mode for one command.
XHistory is not recorded for this escape,
Xand line mode macros are not available.
XIf no command is given, curses mode
Xis exited and the session continues in line mode
X(in which case history and macros become available).
X.PP
XWhen setting new key sequences to be bound to commands, the user may
Xuse control keys and the ESCAPE character for extended commands.
XExceptions are control-C, control-\\, and possibly other control characters
Xdepending on your system's configuration or your current tty mode settings.
X.PP
XWhen assigning key sequences to commands, the user enters the
X.B bind
Xcommand and prompting is done.
XIf the
Xuser wishes to have control characters or the escape character in a key
Xsequence while still using ASCII format, a special notation for control
Xcharacters is provided.
XThis sequence is used primarily for the use of
END_OF_FILE
if test 50598 -ne `wc -c <'mush/mush.1.a'`; then
    echo shar: \"'mush/mush.1.a'\" unpacked with wrong size!
fi
# end of 'mush/mush.1.a'
fi
echo shar: End of archive 2 \(of 19\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 19 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0


