SammyEmacs v1.00 for DOS by Sami Sihvonen 1996
Parts of source code ripped from various people.

        Emacs has been a very popular  editor  since 1970'ties and even
        now, over 25 years later, Emacs is still absolutely best for
        text editing in some areas. And Emacs interface has always been
        very powerfull for the power user who can remember all the
        keyboard combinations. Original Emacs is made by Richard
        Stallman and is still being updated, it is now in 19.x.x version
        when writing this text.

        There is also available huge amount of Emacs clones. Main reason
        is that Emacs is very big on diskspace, memory and system
        resource usage. And on slow or busy systems Emacs will seem
        incredible slow and sluggish, for example in my own old 386sx
        machine that I still use.

        SammyEmacs is also a Emacs clone. It uses under 150 kilobytes
        of diskspace, which includes online documentation for Emacs,
        mouse support and macros. You can use also the plain EXE-file
        and then Sammy will use under 70 kilobytes. Isn't it incredible
        to see a software package that will run under 1 megabyte in
        these days.

        Sammy also is very light on memory usage, 350 kilobytes of free
        conventional memory will allow you to do everything, including
        shelling to DOS and reading online documentation. I have tested
        Sammy under different operating system and no probelms have been
        detected under Windows 3.1, Windows NT 3.51, Desqview 2.60 or
        Linux DosEmu 0.60. When creating memory limits for Sammy in
        multitasking system, give 500 kilobytes of memory if you wan't
        better performance with large files.

        And Sammy also dosen't need much computer power. My 386sx machine
        runs Sammy like a dream and system seems to behave nicely and fast
        even with larger files. Sammy also knows how to release time 
        slices and go idle in multitasking systems (Desqview aware too).

        All this talk about small system requirements does not mean that
        Sammy has no powerfull features. All basic Emacs commands are
        available, including standard configuraion file and macros. Most
        of advanced features work too. This file is not the command
        documentation of Sammy, press F6 while using SammyEmacs are there
        is the real documentation. 

        Please note that standard Emacs help command (C-h C-h) will open
        a new buffer and show contents of EMACS.HLP which is an ascii-file.
        In SammyEmacs it is not included, use F6 to see help. But you can
        put your favourite Emacs guide as EMACS.HLP and then you have it
        available with Emacs help-command. 

        I created SammyEmacs because I wanted to have a small Emacs clone
        that would be quickly to start inside qwk-offline reader. And now
        SammyEmacs is included as internal feature in my own GD-Tagger
        offliner. But now I use Sammy always when I use any PC machine
        to edit text. In my Linux machine I use the real Emacs by Richard
        Stallman. There is also a ported version of Sammy Emacs for Linux
        available, but not yet released.

        SammyEmacs is released to Public Doman, you can use it as much
        as you like. If you wan't to pay money from SammyEmacs, do it
        to The Red Cross or some hospital, they need the money more.

        Standard SammyEmacs distribution includes the following
        files listed below:

        EMACS.RC      This is an ascii file which is executed when you
                      start Sammy. It has correct settings for all
                      function key macros and mouse installion etc. If
                      you remove this file, Sammy will start like a
                      normal Emacs without any extensions or help
                      screens. See EMACS.HLP for more info.
        EMACS.EXE     The main executable of SammyEmacs. It is packed
                      with PkLite to save diskspace and speed up loading
                      from floppy disks. This is the only file needed to
                      run SammyEmacs.
        EMACS.HLP     Helpfile that can be viewed by pressing when
                      inside SammyEmacs.
    
        Versions of SammyEmacs:
    
        13.4.1996  SammyEmacs 0.10
        21.4.1996  SammyEmacs 0.20 
        30.4.1996  SammyEmacs 0.30  
        03.5.1996  SammyEmacs 0.40 
        06.5.1996  SammyEmacs 0.50 - First released version 
        11.5.1996  SammyEmacs 0.60
        12.5.1996  SammyEmacs 0.70 
        16.5.1996  SammyEmacs 0.80 - Second released version
        18.5.1996  SammyEmacs 0.81
        20.5.1996  SammyEmacs 0.83
        23.5.1996  SammyEmacs 0.85
        25.5.1996  SammyEmacs 0.89
        27.5.1996  SammyEmacs 0.90 - Third released version
        05.7.1996  SammyEmacs 0.93 - Fourth released version
        09.7.1996  SammyEmacs 0.94 
        14.7.1996  SammyEmacs 0.95
        16.7.1996  SammyEmacs 0.96
        21.7.1996  SammyEmacs 0.97
        24.7.1996  SammyEmacs 0.99 - Fifth released version
        26.10.1996 SammyEmacs 1.00 - Sixtg released version

    New features in SammyEmacs 1.00:

    - Tested under Windows '95 and supports VFAT
    - Tested under Windows NT 4.0 and supports NTFS
    - Small bugs fixed, some things are little faster now too.

    New features in SammyEmacs 0.99:

    - Requires 21 KB less of harddisk space.
    - Now uses 80 KB less memory, reads files more.
    - Help system is now standard Emacs-style.
    - Desqview aware and goes 100% idle when not used.
    - Default settings tuned again.
    - Many little fixes, massive speed gains in some functions.
    - Few ugly bugs made Sammy crash with file errors, now fixed.


--------------------------------------------------------------------------

	To start editing files, all the keys you really need to know are:

		  [CSR UP]		These keys let you move
		     |			around in the your file
	 [CSR <-]  <--->  [CSR ->]
		     |
		 [CSR DOWN]

		   [F9] 		This saves your file

                   [F10]                This leaves SammyEmacs

	On systems that do not have special function and cursor keys,
        SammyEmacs works by using control keys. On such a system these
	keys perform basic functions:

		^P		Move upward
	^B			Move backward
			^F	Move forward
		^N		Move downward

		^X^S		Saves your file

                ^X^C            Exits SammyEmacs

	An up arrow before the key means to hold the CTRL key down and
        press the next character. For example, to exit SammyEmacs, hold
	down the CTRL key and strike X and then C.

        All the SammyEmacs documentation talks about commands and the
        keystrokes needed to use them. Each SammyEmacs command has a name,
	and most of them are bound to a sequence of keys. Whenever we
	refer to a command we will display it's binding (the keys needed
	to activate the command) and the name of the command in
	parenthesis.

	Keystrokes for commands include one of several prefixes, and a
	command character. Command keystrokes look like these:

		^A	hold down <Ctrl>, press 'A'
		M-A	press the META key, release it and press 'A'
		^X-A	Hold <Ctrl>, press 'X', release, press 'A'
		^X-^A	hold <Ctrl>, press 'X', release, hold <Ctrl>, press 'A'
		S-FN1	hold down <SHIFT>, press function key 1
		A-A	hold down <Alt>, press 'a'
		FN^1	hold down <Ctrl>, press function key 1

        SammyEmacs uses a number of defined terms which will help you
	understand the rest of this help document.

    < > COMMANDS	These are built in functions that represent
                        basic things that SammyEmacs does. For example,
			the cursor up key activates the "previous-line"
			command which moves the cursor up to the line
			of text immediately before the current line.

    < > BINDINGS	A binding is a link between a sequence of keys
			and a command. The command previous-line is bound
			to the cursor up key, and to the ^P key. Pressing
			a key sequence causes the command to which it is
			bound to execute.

        META KEY	is the key used to start many commands. On most
			keyboards this is the [ESC] key, but many times
			it is rebound/changed to the key in the upper
			left corner of the keyboard. This is often the
			grave accent symbol.

    < > BUFFERS		These are areas of memory set aside to hold text.
			Each buffer has a buffer name which is used to
			refer to it, and a file name from which it has
			been read or where it will be written.

    < > WINDOWS		Sections of the current screen which display a
			portion of a buffer. More than one window may be
			visible at a time. Multiple windows split the
			screen horizontally.

    < > SCREENS		are collection of windows. On a older text style
			system, one screen is displayed at a time. On
			a newer window based system, like OS/2, the
			Macintosh or MicroSoft Windows, each operating
                        system window can display a different SammyEmacs
			screen.

        MODE LINE	is the line at the bottom of each window naming
			the buffer being displayed, along with its file
			name. Also the active modes of the window are shown.

        COMMAND LINE	is the line at the bottom of the each screen
			where you give more information to some commands.

    < > MACROS          are programs written in the SammyEmacs language
			which let you automate repetitive editing tasks.
			These help pages are being run by a relatively
                        simple, but powerful SammyEmacs macro.

    < > KEYBOARD MACROS

			These are remembered sequences of keystrokes which
			can be used to greatly speed quick and dirty
			repetitive editing.

    < > PAGES		These are groups of macros which have been written
			to handle a particular editing task, and which have
                        been packaged to be available from the SammyEmacs
			startup file. These macros are bound to shifted
			function keys.

    < > POINT		The position in the text of the current window
			of the cursor. The point is considered between
			the character the cursor rests on and the one
			immediately behind it.

    < > MARK		Position in the current buffer which delimits
			the beginning of a region. Various commands
			operate on text from the MARK to the POINT,
			or move the current point to the MARK.

	Commands for searching for and replacing strings come in a number
	of different flavors. The simplest commands is:

	^S (search-forward)

	Typing this command results in a prompt like this:

	Search []<META>:

	Any text shown in the square brackets will be searched for if you
	don't type in any string. This is called the default search
	string. The key shown in the angle brackets is the key you type to
	end the search string, which is called the search terminator key.
	Normally, it is the META, or ESCape key. This lets you to use the
	return key (<NL>) in a search string. So if you want to find the
	string "mystic", you would type the word, and then ESCape key. The
	point would jump to the end of the next occurrence of "mystic",
        or, if there are none, SammyEmacs displays "not found".

	^R (search-reverse)

	This works like ^S except that it searches backwards through the
	text for the last occurrence of the string. It leaves the point at
	beginning of the string found.

	A-S (hunt-forward)

	This command searches for the next occurrence of the last search
	string entered, without prompting for another string. To use this
	command, hold down the ALT key and type 's'. This keystroke may
	not be available on all keyboards.

	A-R (hunt-backwards)

	This searches backwards for the last occurrence of the last search
	string entered. This also is only available on some keyboards.

	M-R (replace-string)

	This will prompt for two strings. The first string is replaced
	with the second from the current position to the end. Both strings
	may have defaults. If you want to replace a string with nothing,
	and there is a default on the replacement string, striking ^K will
	override the default and enter a blank string.

	M-^R (query-replace-string)

	Otherwise like replace-string, this command prompts at each
	string. Typing 'Y' replaces the current string, 'N' skips the
	current string, '!' replaces the current and all following strings
	without asking, 'U' skips to the previous replacement and undoes
	it, '^G' aborts the command, leaving the point at the current
	word, '.' aborts and moves the point back to where the command
	was originally given, '?' lists the available options.

        Regions are used in SammyEmacs to specify what text is acted on by
	many commands. A region is defined as all the text between the
	point, and the last placed MARKed. To define a region:
	
	1) Move the point to the beginning of the text you
	   want to effect

	2) Use the M-<space> (set-mark) command to position
	   the MARK at the current point

	3) Move the point to the end of the text you want to effect

	At this time, the text between the MARK and the POINT is the
	current region which will be effected by many commands. Regions
	can be defined backwards as well as forwards, and can include the
	entire text, or as little as one character.

	To move text from one place to another:
	
	1) Move to the beginning of the text you want to move.
	
	2) Set the mark here with the M-<space> (set-mark) command.
	
	3) Move the point to the end of the text.
	
	4) Use the ^W (kill-region) command to delete the region you just
	   defined. The text will be saved in the "kill buffer".
	
	5) Move the point to the place you want the text to appear.
	
	6) Use the ^Y (yank) command to copy the text from the kill buffer
	   to the current point.
	
	Repeat steps 5 and 6 to place more copies of the same text.

	Copying text, without deleting the original is just like cutting
	and pasting it, except that in place of the ^W (kill-region)
	command, you use the M-W (copy-region) command which copies the
	current region into the kill buffer without deleting it.
	
	The kill buffer accumulates and text which is deleted by ^W, M-W
	or a number of other delete commands. If more than one delete
	command is used in a row, all the text from all the commands will
	be in the kill buffer. Using any command between deletes causes
	the kill buffer to discard earlier deletes and just hold the most
	recent deletions.
	
	Since there is only one kill buffer, you can switch between
	windows, screens and files to copy text from one file to another.
	There is no limit to the amount of text that can be stored in the
	kill buffer except that of the memory of the computer running
        SammyEmacs. Extremely large kills will take a few seconds.

        A buffer is where SammyEmacs stores text. Normally that text is
	read from a file, and is visible in a editing window. But text stored
        in buffers can also be SammyEmacs macros, temporary storage for
	macros, or lists of screens, files, buffers, variables, functions
        or bindings created by SammyEmacs commands. Buffer commands include:
	
	^X-B	(select-buffer)

	This prompt for a buffer name, and then makes that buffer the one
	visible in the active window. If the buffer does not yet exist, it
	will create it.

	^X-K	(delete-buffer)

        SammyEmacs attempts to discard the named buffer, reclaiming the
	memory it occupied. It will not allow the destruction of a buffer
	which is currently visible through any window on any screen.

	^X-^B	(list-buffers)

	This pops up a list of all the buffer names, the file the buffer was
	read from, the size, and the active modes for each buffer. Using a
	numeric argument (M-<n>) with the command will list hidden buffers
        used by SammyEmacs and its macros.

	A '@' in column one shows that a file has already been read into a
	buffer. A '*' in column two means that the buffer has been changed
	since the last time it was written to disk. A '#' in column three
	indicates the file was to large to read into memory and was truncated.

	^X-X	(next-buffer)

        This command causes SammyEmacs to switch the active window to
	display the next buffer in the buffer list. This can be used to
	easily step through all the buffers.

	The only limit to the number of buffers is the memory of your
        computer. In DOS version of SammyEmacs you can use all available
        memory, including XMS and EMS. With NT version of SammyEmacs,
        you can also use virtual memory services proved by Windows NT.
        You can estimate the memory used by adding up the size of all the
	files you want to edit simultaneously, multiply by 1.4, and add
        170K for the size of SammyEmacs (EXE-file is unpacked). This
        results in the amount of free memory needed to edit these files.

        Under a DOS machine with 574K free from dos, you can edit files
	totaling 288K in size.

        SammyEmacs uses windows to display and allow you to edit the
	contents of buffers. A single screen will show one or more
	windows, separated by a modeline which describes the contents of
	the window above it. Here are some window commands:

	^X-2	(split-current-window)

	This command splits the current window into two windows. Both
	windows view the current buffer at the current POINT.

	^X-O	(next-window)	^X-P	(previous-window)

	These commands make the next window down, or the previous window
        upward the current window. SammyEmacs highlights the mode line of
	the currently active window, and places the machine's cursor at
	the POINT.

	^X-1	(delete-other-windows)

	This command deletes all other windows but the active window.

	^X-0	(delete-window)

	This removes the active window from the screen, giving its space
	to one of the adjacent windows. It does not discard or destroy any
	text, just stops looking at that buffer. You can not delete the
	last window on the screen.

	^X-^N	(move-window-down)	^X-^P	(move-window-up)

	These commands moves the windows view into it's buffer up or down
	by one line. Preceding the command with M-<n> will move the
	window's view up or down by <n> lines.

	M-<n> ^X-W	(resize-window)

	Type META, followed by a number, and then the resize-window
	command, ^X-W. This attempts to change the length of the current
	window (and it's mode line) to the number of lines you typed.
	This may not always be possible depending on the size of the
	other windows.

	^X-^	(grow-window)		^X-^Z	(shrink window)

	These commands attempt to change the size of the active window by
	one line.

	A Screen is a collection of windows and a command line which are
	displayed together. On some non-graphically oriented systems, such
	as UNIX, only one screen is displayed at one time. Under other
	graphical oriented operating systems like WINDOWS 3, X-WINDOWS,
	the Macintosh or the Amiga, each screen is displayed in an
        operating system "window". Notice that the SammyEmacs usage of the
	word window is different from the meaning used in these graphical
	systems.

                SammyEmacs term         OS term

		    Window	==	Pane
		    Screen	==	Window

	Each screen has its own set of windows and its own command line.
	Switching from one screen to another will preserve the window
	setup, the colors and the buffers being displayed.

        Under DOS, SammyEmacs uses a simple windowing system which
	can display more than one screen at once. Look at the section
	on using the mouse to learn how these screens can be manipulated.

	A-F	(find-screen)

	This prompts you for a screen name. If it does not exist, it is
	created. On text systems, this screen is displayed. On graphic
	systems, the OS window containing this screen is brought to front.
	Clicking on an existing window will also switch to that screen.

	A-C	(cycle-screen)

	This command takes the rearmost screen, the last screen in
	the screen list, and moves it to the front.

	A-D	(delete-screen)

	This command deletes any screen which is not the active screen.
	Buffers being displayed on that screen are not discarded. On
	graphic systems, the screen's OS window is closed. Clicking on
	a close gadget will activate this command.

	A-B	(list-screens)

	A pop up buffer containing a list of all current named screens
	and the names of the buffers visible in the windows on that screen

	^X-^F	(find-file)

        This command causes SammyEmacs to prompt you for the name of a
	file you want to edit. If that file is already somewhere in the
	editor, it brings it up in the current window. If it is not, it
	searches for it on disk. If it exists, it creates a new buffer
	and reads the contents of the file into it. If it does not yet
	exist, it simply creates a new buffer. In any case the buffer
	is brought up in the current window. If you press a space or ESC
        while typing in the filename, SammyEmacs will attempt to complete
	the name for you.

	^X-^S	(save-file)	[also F9 on some systems]

	If the text in the current buffer has been changed since it has
        been read, SammyEmacs will write the changed text back to the
	disk file it came from.

	^X-^R	(read-file)

	Use this command to read a file into the current buffer, replacing
        its original text with that from the file. SammyEmacs' concept of
	the current file name will not change, so make sure that replacing
	the text in the original file with that from the read one is what
	you are intending when you use this command.

	^X-^W	(write-file)

	This writes the text in the current buffer to a file with a name
        different from what SammyEmacs thought it was originally. This
        does change SammyEmacs concept of the current buffer's file name.

	M-Z	(quick-exit)

        This special exit command leaves SammyEmacs, but only after
	writing out all changed buffers.

	^X-^I	(insert-file)

	This will ask you for the name of a file to insert into the
	current buffer, at the point.

	^X-^A	(append-file)

	Similar to write-file, this command writes out the current buffer
	to the named file. But rather than replacing its contents, it
	appends it to the end of the existing text in the file. This does
	not change the filename of the current buffer. This is handy for
	building log files.

	^X-N	(change-file-name)

	This command lets you directly change the filename associated
	with the current buffer.

        Commands within SammyEmacs have descriptive names which you can
	use to invoke them, or bind them to a keystroke. To execute one
	of these commands, use the execute-named-command (M-X) command.
	A colon (:) will appear on the command line. Type in the name of
	the command and strike <enter>. The command will execute. If you
        type a <space> or the META key while typing, SammyEmacs will
	attempt to complete the name for you.

        To get a list of ALL the commands in your current SammyEmacs, type:

		M-X describe-bindings

	This will display a paged list of all legal commands and the
	keystrokes to use to invoke them.

	Some commands take a number as an argument. For example, to move
	to a particular line within a file, you use the goto-line (M-G)
	command. To go to a particular line, precede the command with
	a number by striking the META key, typing a number, and then
	the keys bound to the command. To go to the 123rd line of a file:

		<META>123<META>g

	If a command does not need a numeric argument, it is taken as
	a repeat count. This also works when typing any character!
	To make a line of 50 dashes type:

		<META>50-

	--------------------------------------------------

        Execute-command-line (M-^X) lets you type in a SammyEmacs
        command line. SammyEmacs macros are made from sequences of
	these command lines. A command line has three parts:

		<numeric argument> <command> <arguments>

	To insert the string <*><*><*> at the point, type M-^X and then:

		3 insert-string "<*>"

	or to set the current fill column to 64, type M-^X and then:

		64 set-fill-column

        SammyEmacs lets you decide what keys activate what command!

	M-K	(bind-to-key)

	prompts you for a command name, and a keystroke to bind to that
	command. A keystroke can be bound only to one command at a time,
	so when you bind it, its old definition is forgotten. This command
	can be used to permanently change your key bindings by placing it
	at the end of your emacs.rc (.emacsrc under UNIX) file. For example,
	if you have one of those nasty keyboards with a tilde (~) in the
	upper left corner, where ESC should be, and you want the tilde
	to become the META key, add this line to the end of emacs.rc:

		bind-to-key meta-prefix ~

        You can use this command to make SammyEmacs feel similar to any
	other editor by changing what keys activate which commands.

	M-^K	(unbind-key)

	This prompts you for a key, and then disconnects if from
	executing any command. Useful if you have a function key you
        keep tripping over, or if you are trying to make SammyEmacs look
	like a much more minimalistic editor.

	(describe-bindings)

	Executed with the M-X command, this command pops up a list of
        all SammyEmacs commands, each with all the keys which are currently
	bound to it.

        Modes determine how SammyEmacs will treat text. Modes effect the
	contents of a buffer. Global modes determine the modes of newly
	created buffers.

	^X-M (add-mode)			Adds a mode to the current buffer
	^X-^M (delete-mode)		Removes a mode from the current buffer
	M-M (add-global-mode)		Adds a global mode
	M-^M (delete-global-mode)	Removes a global mode

        These are some of SammyEmacs's modes:

	< >  ASAVE mode		< >  EXACT mode		< >  REP mode

	< >  CMODE mode		< >  MAGIC Mode		< >  VIEW mode

	< >  CRYPT mode		< >  OVER mode		< >  WRAP mode

	ASAVE mode			Automatically Save

        When this mode is on, SammyEmacs automatically saves the contents
	of your current buffer to disk every time you have typed 256
	characters. The buffer is saved to the file named on the mode line
	of the buffer. This mode assures you that you will loose very
	little text should your computer crash while you are editing. Be
	sure you are willing to have your original file replaced
	automatically before you add this mode.

	The frequency of saving can be altered by changing the contents of
	the $asave environment variable. Use the set command like this:

	^X-A $asave 2048

                to change SammyEmacs to automatically save the current
	buffer after every 2048 characters are typed.

	CMODE mode			Editing C programs

	This mode is specifically for editing programs written in the C
        language. When CMODE is active, SammyEmacs will try to anticipate
	what indentation is needed when the <NL> key is used. It will
	always bring a pound sign (#) with only leading white space back
	to the left margin. It will attempt to flash the proper character
	matching any close symbol as the close symbol is typed.

        The standard startup files for SammyEmacs will install a macro
        which checks any file being read into SammyEmacs and sets CMODE if
	the file ends with a .c or .h extension.

	M-^F	(goto-matching-fence)

	Place the point on any brace, bracket, or parenthesis and use
        this command, SammyEmacs will jump to the matching character. If
	there is none, a beep will sound.

	CRYPT mode			Encryption

        For files of a sensitive nature, SammyEmacs can encrypt text as it
	is written or read. When you write out text, if CRYPT mode is
	active and there is no encryption key, emacs will ask:

	Encryption String:

	Type in a word or phrase of at least five characters or more for
	the encryption to use. If you look at the file which is then
	written out, all the printing characters have been scrambled. To
        read such a file back in, call up SammyEmacs like this:

	emacs -k <filename>

		and you will be asked the encryption key before the file is
	read. The encryption algorithm is a Beaufort Cipher with a
	variant key. This is reasonably difficult to decrypt.

	EXACT mode			Character Case during Searches

        Normally, when using search or replace commands, SammyEmacs
	ignores the case of letters for comparisons. With EXACT mode set,
	the case of the characters must be the same for a match to occur.

	MAGIC mode			Regular Expression Pattern Matching

        Normally, SammyEmacs uses the string you type in response to a
	search or replace command as the string to find.  When magic mode
        is enabled, SammyEmacs considers the string you type as a pattern
	or template to use in finding a string to match.  Many characters
	in this template have special meaning:

	.		any single character, except newline.
	[<set>]		any single character from the bracketed set.
	^		beginning of a line.
	$		end of a line.
	\		the next character has no special meaning,
			   take the next character literally
			   (unless it is a parenthesis)

	Here are some more special characters in MAGIC mode:

	?		the preceding character (or . or [<set>]) is optional.
	*		the preceding character (or . or [<set>]) matches
			zero to many times.
	+		the preceding character (or . or [<set>]) matches
			one to many times.
	\(<group>\)	define a group for the replacement string, or for
			the &GROUP function.

	Some characters in the replacement string can have special meanings:

	&		insert all of the text matched by the search.
	\		the next character has no special meaning (but
			see groups...)
	\1 to \9	insert the text defined by the nth group in the
			search string.

	OVER mode			Overstrike Mode

        SammyEmacs is normally in what many other editors consider
        "insert" mode. This means when you strike a character, SammyEmacs
	makes room for that character in the current line, inserting it
        between the existing characters. In OVER mode, SammyEmacs instead
	overwrites characters, replacing the existing character under the
	point with the character you type. OVER mode will maintain the
	position of text lined up using tabs while replacing existing
	text.

	Be wary editing Japanese KANJI characters while in this mode, it
	is possible to overwrite the first byte of the character, leaving
	the second byte meaningless and alone.

	WRAP mode			Wrap entered text

	This mode causes the point and the previous word to jump down to
	the next line when you type a space and are beyond the current
	fill column. This is normally set to column 72, allowing you to
	enter text non-stop on a standard screen without bothering to use
	the return key.

	To change the column that text is wrapped past, use the set
	command to change the value of the $fillcol environment variable,
	like this:

	^X-A $fillcol <new value>

        SammyEmacs will then wrap words past column <new value>.

	VIEW mode			No Changes Permitted

	When in VIEW mode, no command which would change the text is
	allowed. If you attempt any such command, or try to type in any
        text, SammyEmacs responds with:

	[Key Illegal in View Mode]

	This mode is very useful when you want to just look at some
	existing text, as it will prevent you from changing that text.
        Also SammyEmacs will not attempt a file lock if a file is read in
	VIEW mode, allowing you to view files which you don't have write
	access to, or other people have locked. To read a file in view
	mode from the command line, type:

	emacs -v <filename>

	REP mode			Replace Mode

        SammyEmacs is normally in what many other editors consider
        "insert" mode. This means when you strike a character, SammyEmacs
	makes room for that character in the current line, inserting it
        between the existing characters. In REP mode, SammyEmacs instead
	replaces the existing character under the point with the
	character you type. REP mode will not maintain the position of
	text which takes up multiple columns using tabs since it will
	replace a single tab character with the typed character which will
	not take up the same space on screen.

	However, Japanese KANJI characters will correctly replace and be
	replaced in this mode as the two bytes will be considered together
	when either style character is used.

	The TAB key can operate in many different ways from within
        SammyEmacs. These commands sequences change its behavior.

	M-<n> <TAB> (handle-tab)

	Using the TAB key with a non-zero numeric argument tells
        SammyEmacs to use soft-tabs, meaning to use spaces to simulate
	tab stops every <n> characters.

	M-0 <TAB> (handle-tab)

        This tells SammyEmacs to use real tab characters (^Is) when
	the TAB key is pressed. The tab stops are set every 8 characters
	by default. This can be changed be setting the $hardtab variable.

	^X-^E	(entab-region)

	This command converts any eligable sequences of spaces in the
	currently defined region into tabs, honoring the current
	$hardtab value. This will reduce the size of most text files.

	^X-^D	(detab-region)

	Any tabs in the currently defined region are expanded to spaces.
	This preserves the current look of the file, and is usefull when
	a line is to be processed by a macro.

	^X-^T	(trim-region)

	While not a tab command, this one is often used in conjunction
	with the tab commands. All the lines in the currently defined
	region are stripped of any trailing whitespace.

	These commands let you interact with the Operating System

	^X-^C	(exit-emacs)

        Most important of commands, you use this the exit SammyEmacs.
	If you have any buffers with text that has been changed, you
	will be asked if you are sure you want to leave.

	^X-!	(shell-command)

	Call up the operating system shell to execute a line which
        SammyEmacs will prompt you for. If this is used interactively,
	the editor will politely wait for you to press a key on the way
	back in so you can view the results of your command.

	^X-$	(execute-program)

	This attempts to call up an external program directly, not through an
	intervening shell. Without the shell, the call is faster and uses less
	memory, but it can not be used to execute internal shell commands. (You
        can not use it for the "DIR" command under DOS!)

	^X-@	(pipe-command)

	This command uses the shell to execute a program, but rather than
	displaying what the program prints, it attempts to place it in a
	buffer to let you edit or save it.

	^X-#	(filter-buffer)

	The contents of the current window are fed to a filter program
	(like SORT) and the results replace the original.

        SammyEmacs defines a paragraph as any lines of text surrounded
	by blank lines. A line starting with a tab or one of the characters
	in the $fmtlead variable is considered the first line of a paragraph.

	If you are editing text destined for use by a text formatter, set
	$fmtlead to the command character for that formatter. That will
        prevent SammyEmacs from formatting what should be lines of commands
	meant for the formatter. If, for example, you are editing SCRIBE
	source, use the ^X-A (set) command to set $fmtlead to "@".

	Commands that manipulate paragraphs include:

	M-N	(next-paragraph)

	This command moves the point just past the last character of the
	current paragraph. If already at the end, it will move to the end
	of the next paragraph.

	M-P	(previous-paragraph)

	The point is moved to the first character of the current paragraph.
	If already at the beginning, it will move back to the previous one.

	M-^W	(kill-paragraph)

	This deletes the current paragraph, leaving a copy in the kill
	buffer.

	M-Q	(fill-paragraph)

	This all important commands re-formats the current paragraph,
	causing all of its text to be filled out to the current fill column
	(Which is 72 by default and is set with $fillcol).

	Words are defined, by default, as a string of characters consisting
	of alphabetics, numbers and the underscore(_) character. You can
	change this be setting the $wchars variable to a list of all the
	characters you want considered as part of a word.

	Commands to manipulate words include:

	M-F	(next-word)	[<CTRL> -> on PC keyboards]

	This positions the point at the beginning of the next word.

	M-B	(previous-word)	[<CTRL> <- on PC keyboards]

	This positions the point at the beginning of the previous word.

	M-D	(delete-next-word)

	Delete from the current position to the beginning of the next word.

	M-^H	(delete-previous-word)

	Dete the word before the point.

	M-^C	(count-words)

	Show the number of words in the current region, along with the
	number of characters, lines and the average number of characters
	per word.

	M-C	(case-word-capitalize)
	M-L	(case-word-lower)
	M-U	(case-word-upper)

	These three commands let you change the case of the word at or
	following the point.

	^X-^L	(case-region-lower)
	^X-^U	(case-region-upper)

	Setting a mark (with M-<space>), moving to the other end of a region
	and using one of these commands will change the case of all the words
	in the selected region.

	Many times you will want to do something to a part of the text
	when the command works on all the text. Also it is helpful to
	see or edit just a portion of the text.

	^X-<	(narrow-to-region)

	All the text in current buffer disappears except what is in the
	currently defined region. The modeline displays "<>" to indicate
	the current window looks into a narrowed buffer.

	^X->	(widen-from-region)

	All the invisible text is restored.

	Computers excel at performing the same task multiple times. You
	should never have to perform the same edit more than once. These
	commands show how:

	^X-(	(begin-macro)

        This commands tells SammyEmacs to begin memorizing any keystrokes,
	commands or mouse clicks.

	^X-)	(end-macro)

        SammyEmacs stops recording when this command is given.

	^X-E	(execute-macro)

	This command replays everything recorded last.

	To perform any repetitive task, where you have a list of things
	that need to be changed, one per line, follow these steps:

	1) Position the point to the beginning of the line to change

	2) Strike ^X-( to start recording

	3) make the change, staying on that line

	4) move to the beginning of the next line

	5) Strike ^X-) to stop recording

	Now hit ^X-E once to test your change on the next line. Did it
	work? If so count how many lines need to yet be changed, strike
	the META key followed by that number and ^X-E. Voila! Your change
	has been made on all the lines.

        Here is the complete list of commands:

^G      abort-command           Abort any command waiting for input
M-M     add-global-mode         Add a global mode for all new buffers
^XM     add-mode                Add a mode to the current buffer
^X^A    append-file		Append current buffer to file
M-A     apropos                 List out commands containing a given string
^B      backward-character      Move one character to the left
^X(     begin-macro             Begin recording a keyboard macro
M-<     beginning-of-file       Move to the beginning of the current file
^A      beginning-of-line       Move to the beginning of the current line
M-K     bind-to-key             Bind a key to a function
^X=     buffer-position         List cursor position
^X^L    case-region-lower       Make a marked region all lower case
^X^U    case-region-upper       Make a marked region all upper case
M-C     case-word-capitalize    Capitalize the following word
M-L     case-word-lower         Lower case the following word
M-U     case-word-upper         Upper case the following word
^XN     change-file-name        Change the name of the current file
unbound change-screen-column	Change column of upper left of current screen
unbound change-screen-row	Change row of upper left of current screen
unbound change-screen-size      Change the number of screen lines
unbound change-screen-width     Change the number of screen columns
^L      clear-and-redraw        Clear and redraw the physical screen
unbound clear-message-line      Clear the command line
M-W     copy-region             Copy the region to kill buffer
M-^C    count-words             Count words, lines and characters in region
^X      ctlx-prefix             Change the key used as the ^X prefix
^XY     cycle-ring		Reposition current string in kill ring
A-C	cycle-screens		Bring the rearmost screen to front
^X^O    delete-blank-lines      Delete all blank lines around the cursor
^XK     delete-buffer           Delete a non-displayed buffer
M-^M    delete-global-mode      Turn off a global mode
M-^Y    delete-kill-ring	Throw out all kill ring text
^X^M    delete-mode             Turn off a mode in the current buffer
^D      delete-next-character   Delete the character following the cursor
M-D     delete-next-word        Delete the word following the cursor
^X1     delete-other-windows    Remove all other displayed windows
^H    delete-previous-character Delete character to the left of the cursor
M-^H    delete-previous-word    Delete the word to the left of the cursor
A-D     delete-screen           Delete a non-displayed screen
^X0     delete-window           Remove the current window from the screen
unbound describe-bindings       List all legal commands
unbound describe-functions      List all defined functions
^X?     describe-key            Describe the command bound to a keystroke
unbound describe-variables      List all variables
^X^D    detab-region            Change tabs in region to equivalent spaces
^XG     display                 Display variables current value
^X)     end-macro               stop recording a keyboard macro
M->     end-of-file             Move to the end of the current buffer
^E      end-of-line             Move to the end of the current line
unbound end-of-word             Move to the end of the current word
^X^E    entab-region            Change spaces to tabs where possible
^X^X    exchange-point-and-mark Swap cursor and mark positions
unbound execute-buffer          Execute a buffer as a macro
M-^X    execute-command-line    Execute a command line
M-^S    execute-file            Execute a file as a macro
^XE     execute-macro           Play back a keyboard macro
(none)	execute-macro-<n>       Execute numbered macro <N> (<N> = 1 thru 40)
M-X     execute-named-command   Execute a command by name
M-^E    execute-procedure       Execute a procedure by name
^X$     execute-program         Execute a program directly (not thru a shell)
^X^C    exit-emacs              Exit EMACS.
M-Q     fill-paragraph          Fill the current paragraph
^X#     filter-buffer           Filter current buffer thru external filter
^X^F    find-file               Find a file to edit in the current window
A-F     find-screen             Find and make current a named screen
^F      forward-character       Move cursor one character to the right
M-G     goto-line               Goto a numbered line
M-^G    goto-mark               Goto a numbered mark (0 by default)
M-^F    goto-matching-fence     Goto the matching fence
^X^     grow-window             Make the current window larger
^I      handle-tab              Insert a tab or set tab stops
M-?     help                    Read EMACS.HLP into a buffer and display it
A-R     hunt-backward           Hunt for last match of previous search string
A-S     hunt-forward            Hunt for next match of previous search string
^XC     i-shell                 Shell up to a new command processor
^XS     incremental-search      Search for a string, incrementally
M-)     indent-region           Indent region one tab stop
^X^I    insert-file             insert a file at cursor
^C      insert-space            Insert a space to the right of the cursor
unbound insert-string           Insert a string at the cursor
M-^W    kill-paragraph          Delete the current paragraph
^W      kill-region             Delete marked region, save to kill buffer
^K      kill-to-end-of-line     Delete the rest of the current line
unbound label-function-key      Label a function key (hp150 only)
^X^B    list-buffers            List all existing buffers
A-B     list-screens		List all existing screens
^X^K    macro-to-key		Bind a key to a macro
^[      meta-prefix             Key used to precede all META commands
^X^N    move-window-down        Move all lines in the current window down
^X^P    move-window-up          Move all lines in the current window up
M-^N    name-buffer             Change the name of the current buffer
^X<     narrow-to-region        hides all text not in the current region
^M      newline                 Insert <NL> at the cursor
^J      newline-and-indent      Insert <NL> at the cursor and indent
^XX     next-buffer             Switch to next buffer in buffer list
^N      next-line               Move the cursor down one line
^V      next-page               Move the cursor down one page
M-N     next-paragraph          Move cursor to the next paragraph
^XO     next-window             Move cursor to the next window
M-F     next-word               Move cursor to beginning of next word
unbound nop                     Does nothing
^O      open-line               Open a line at the cursor
unbound overwrite-string        Overwrite a string at the cursor
^X@     pipe-command            Execute an external command, record output
unbound pop-buffer              Display named buffer as a pop-up
^P      previous-line           Move cursor up one line
^Z      previous-page           Move cursor up one page
M-P     previous-paragraph      Move back one paragraph
^XP     previous-window         Move the cursor to the last window
M-B     previous-word           Delete the word to the left of the cursor
unbound print                   Display a string on the command line
M-^R    query-replace-string    Interactively replace one string with another
M-Z     quick-exit              Exit EMACS, writing out all changed buffers
^Q      quote-character         Insert the next character, literally
^X^R    read-file               Read a file into the current buffer
M-^L    redraw-display          Redraw display, centering current line
^X      remove-mark             Erase numbered mark
A-N     rename-screen		Change the name of the current screen
M-R     replace-string          Replace one string with another
^XW     resize-window           Change number of lines in current window
unbound restore-window          Move cursor to the last saved window
^XR  reverse-incremental-search Search backwards, incrementally
M-^E    run                     Execute a named procedure
^X^S    save-file               Save the current buffer if it is changed
unbound save-window             Remember current window (to restore later)
M-^V    scroll-next-down        Scroll the next window down
M-^Z    scroll-next-up          Scroll the next window up
^S      search-forward          Search for a string
^R      search-reverse          Search backwards for a string
^XB     select-buffer           Select buffer to display in current window
^XA     set                     Set a variable to a value
M-E     set-encryption-key      Set encryption key of current buffer
^XF     set-fill-column         Set current fill column
M-      set-mark                Set a mark
^X!     shell-command           Causes external shell to execute command
unbound show-files              List contents of directory
^X^Z    shrink-window           Make the current window smaller
M-^S    source                  Execute a file as a macro
^X2     split-current-window    Split the current window in two
unbound store-macro             Store following macro lines to numbered macro
unbound store-procedure         Store following macro lines to named procedure
^T      transpose-characters    Transpose char at cursor with char to left
^X^T    trim-region             Trim any trailing white space from a region
M-^K    unbind-key              Unbind a key from a function
M-(     undent-region		undent region one tab stop
^U      universal-argument      Execute the following command 4 times
M-~     unmark-buffer           Unmark the current buffer
unbound update-screen           Force a screen update during macro execution
^X^V    view-file               Find a file, and put it in view mode
^X>     widen-from-region       restores hidden text
unbound wrap-word               Wrap the current word
^X^W    write-file              Write current buffer under new file name
unbound write-message           Same as print
^Y      yank                    yank kill buffer into current buffer at cursor
M-Y     yank-pop		yank the next string in the kill ring

        On some systems, SammyEmacs can use the mouse to perform many
        basic editing tasks. If your platform and SammyEmacs support the
	mouse you can do any of these operations. (Mouse behavior can be
	changed inside a macro, like this help system, so try these
	AFTER you exit from HELP).

	Repositioning the POINT

		Move the mouse to where you want the point to be, and click
		once with the left mouse button and release. The point will
		move there, making any screen or window active to do so.

	Scrolling text inside a window

		Position the mouse to the text to drag, press the left button,
		move the mouse to where to display the text (horizontally
		or vertically), and release the mouse button.

	Moving a Modeline

		Position the mouse any any modeline except the last, press
		the left button, move to another position and release the
		button. The modeline will move, resizing the windows which
		are above and below.

	Copy a region

		Position the mouse at the beginning of the region to copy,
		press the right button, move the mouse to the end of the
		region, release the button.

	Kill a region

		After copying a region, without moving the mouse, click the
		right mouse button once. The text will disappear.

	Pasting Cut Text

		Move anywhere away from the place the text was deleted,
		and click the right button once. The last text placed in the
		kill buffer will be inserted.

	Resizing the current screen

		Move the mouse to the last position of the command line.
		Press the left button down. Move the mouse to a new place
		for the lower right corner of the current screen and release.

	Moving the current screen

		Move the mouse to the upper left of the screen, Press down
		the left button. Move to a new position and release the
		button. The screen will move to the new position.

	Create a New Screen

		Move to the upper left corner of any existing screen. Press
		down on the left mouse button. Move to a new position and
		release the button. A new screen containing the buffer
		current in the old will appear with the same size as the
		copied screen.

	Deleting a Screen

		Click once on the command line of a screen with the right
		mouse button. It will disappear. If it is the only screen
                visible, SammyEmacs will exit.

        SammyEmacs Function Summary             <num>   Numeric string
						<str>	any string
Return	Function				<log>	logical value
Value	     Arguments		Description	-----	No return value
-------------------------------------------
<num>	&abs <num>		Returns the absolute value of <num>
<num>	&add <num> <num>	Add two numbers
<log>	&and <log1> <log2>	Returns TRUE if BOTH logical arguments are TRUE
<num>	&asc <str>		get ASCII code of first char in str
<num>	&ban <num> <num>	Bitwise AND function
<str>	&bin <str>		return the function name bound to <str>
<num>	&bno <num>		Bitwise NOT function
<num>	&bor <num> <num>	Bitwise OR function
<num>	&bxo <num> <num>	Bitwise XOR function
<str>	&cat <str> <str>	Concatenate the two strings to form one
<str>	&chr <num>		get character represented by ascii code <num>
<num>	&div <num1> <num2>	Divide num1 by num2
<str>	&env <str>		get environment variable <str>
<log>	&equ <num> <num>	Is <num> and <num> numerically equal?
<log>	&exi <str>		Does the named file <str> exist?
<str>	&fin <str>		Find file names <str> with full path
<log>	&gre <num1> <num2>	Is <num1> > <num2> numerically?
<str>	&gro <num>		Get <num> as set by a MAGIC mode search.
<str>	&gtc			Get EMACS command input
<str>	&gtk			Get single keystroke from user
any	&ind <str>		Evaluate <str> as a variable.
<log>	&isn <str>		Is str numeric?
<str>	&lef <str> <num>	get <num> leftmost characters from <str>
<num>	&len <str>		find length of str
<log>	&les <num1> <num2>	Is <num1> < <num2> numerically?
<str>	&low <str>		Lowercase <str>
<str>	&mid <str> <num1> <num2> Get <num2> chars from <str> at <num1>
<num>	&mod <num1> <num2>	Remainder of num1 / num2
<num>	&neg <num>		Negates number
<log>	&not <log>		Return the opposite logical value
<log>	&or <log1> <log2>	Returns TRUE if either argument is TRUE
<str>	&rev <str>		Return a string with reversed characters
<str>	&rig <str> <num>	Get the <num> rightmost characters from <str>
<num>	&rnd <num>		Returns a random integer between 1 and <num>
<log>	&seq <str1> <str2>	Is <str1> = <str2> alphabetically?
<log>	&sgr <str1> <str2>	Is <str1> >= <str2> alphabetically?
<num>	&sin <str1> <str2>	find position of str2 in str1 (0 if fails)
<log>	&sle <str1> <str2>	Is <str1> < <str2> alphabetically?
-----	&slo <str1> <str2>	Set lowercasing table
<num>	&sub <num> <num>	Subtract two numbers
-----	&sup <str1> <str2>	Set uppercasing table
<num>	&tim <num> <num>	Multiply two numbers
<str>	&tri <str>		Trim the trailing whitespace from a string
<log>	&tru <num>		Is num answer to Life, The Universe, Everything?
<str>	&upp <str>		Uppercase <str>
<str>	&xla <str1> <str2> <str3> Translate str1 via str2<->str3 table


$acount		countdown of inserted characters until the next autosave
$asave		number of inserted characters between automatic file-saves
$bufhook	macro called on buffer entry
$cbflags	current buffer's attribute flags
$cbufname	buffer name of the current buffer
$cfname		file name of the current buffer
$cmdhook	function run before each user command
$cmode		mode of the current buffer
$curchar	ascii value of the character currently at the point
$curcol		current column of point in current buffer
$curline	current line of point in current buffer
$curwidth	number of columns in current screen
$curwind	current window number
$cwline		current display line in current window
$debug		flag to trigger macro debugging
$deskcolor	color to use for current desktop, default to BLACK
$diagflag	allow diaganal mouse drags?
$discmd		echo command prompts? Default is TRUE
$disinp		echo input at the command prompts? Default is TRUE
$disphigh	display high-bit characters symbolically? Default is FALSE
$exbhook	macro to execute when exiting a buffer
$fcol		text column being displayed in first column of current window
$fillcol	current fill column
$flicker	suppress screen flicker (for old IBM-PC CGA adapter)
$fmtlead	list of all formatter lead characters
$gflags		global flags controlling some EMACS internal functions
$gmode		global mode flags
$hardtab	number of spaces between hard tab stops
$hilight	hilight selected region?
$hjump		columns to scroll the screen horizontally when needed
$hscrlbar	display horizontal scroll bars? (under windowing versions)
$hscroll	scroll screen horizontally? or just current line
$isterm		incremental search terminator character
$kill		contains the first 127 characters in the kill buffer
$language	[READ ONLY] name of the language which messages display
$lastkey	[READ ONLY] last keyboard character typed
$lastmesg	[READ ONLY] text of the last message written on command line
$line		current line in the current buffer
$lterm		line terminator characters. default are native ones
$lwidth		[READ ONLY] number of characters in the current line
$match		[READ ONLY] last string matched in a search
$mmove		mode of mouse movement (0=none, 1=default, 2=always)
$modeflag	display mode lines?
$msflag		mouse present?
$numwind	number of windows displayed
$orgrow		desktop row position of current screen
$orgcol		desktop column position of current screen
$os             Operating system SammyEmacs is running under
$overlap	number of lines to overlap during scroll
$pagelen	number of screen lines used currently
$palette	string used to control the palette register settings
$paralead	string containing all paragraph start characters
$pending	[READ ONLY] are there are user keystrokes pending?
$popflag	use pop-up windows? Default is TRUE
$posflag	display line and column position on modeline. Default is FALSE
$progname       [READ ONLY] contains the string "SammyEmacs"
$ram		amount of remaining memory if compiled with RAMSIZE
$readhook	macro to execute before reading in a file
$region		string of the current region. truncates at 255 characters
$replace	current replace pattern used in replace commands
$rval		return value from the last invoked subprocess
$scrname	current screen name
$search		current search pattern used in search and replace commands
$searchpnt	control placement of cursor after searches. 0, 1 or 2
$seed		integer seed of the random number generator
$softtab	number of spaces inserted by EMACS when soft tabbing
$sres		Current screen resolution
$ssave		safe file saving? Default is TRUE
$sscroll	smooth scrolling? Default is FALSE
$status		[READ ONLY] Status of the success of the last command
$sterm		search string input terminator, default is META
$target		target for line moves
$time		[READ ONLY] current date and time. "Mon May 09 10:10:58 1988"
$timeflag	display time of day on modeline? Default is FALSE.
$tpause		Controls length of the pause to display matched fence in CMODE
$version        [READ ONLY] current SammyEmacs version number
$vscrlbar	display vertical scroll bars?
$wchars		letters legal in word. Default is alphanumerics and underscore
$wline		display lines in current window
$wraphook	macro to execute at word wrap time
$writehook	macro to execute when writting file
$xpos		last mouse column
$yankflag	position at end of yanked text?
$ypos		last mouse row
