This is Info file jed.info, produced by Makeinfo-1.55 from the input
file jed.ti.


File: jed.info,  Node: Top,  Next: Introduction,  Up: (dir)

   This file documents the JED editor.

   Copyright (C) 1992, 1993 John E. Davis

* Menu:

* Introduction::
* Installing JED::
* Startup Files::
* Starting JED::
* Emulating Other Editors::  Emacs, EDT, and Wordstar emulation
* File Types and Sizes::
* Backup and Autosave Files::
* Status line and Windows::
* MiniBuffer::
* Basic Editing::
* Modes::
* Keyboard Macros::
* Shells and Shell Commands::
* Getting Help::
* Editing Binary Files::
* Dired::  Using JED to maintain directories
* Mail::
* Customization::
* Eight Bit Clean Issues::
* Miscellaneous::


File: jed.info,  Node: Introduction,  Next: Installing JED,  Prev: Top,  Up: Top

Introduction
============

   This document presents some basic information that users should know
in order to use JED effectively.  Any questions, comments, or bug
reports, should be emailed to the author. Please be sure to include the
version number.  To be notified of future releases of JED, email to the
address below and your email address will be placed on the announcement
list.  The email address is:

                        davis@space.mit.edu  (internet)
                        davis@ohstpy (BITNET)


File: jed.info,  Node: Installing JED,  Next: Startup Files,  Prev: Introduction,  Up: Top

Installing JED
==============

   Building JED from its sources requires the use of a C compiler that
understands function prototypes.  JED has been successfully built with
`cc' on the ULTRIX, VMS, and IRIX operating systems.  In addition, it
has been created using `gcc' under SunOS and Borland's BCC 3.0 for the
PC.

   Detailed installation instructions are in separate, operating system
dependent files.  They are:

            UNIX:   install.unx
             VMS:   install.vms
           IBMPC:   install.pc

   When JED starts up, it will first try to load a site initialization
file called `site.sl'.  Site specific commands are placed here.  Most
likely, `site.sl' will define some functions, default hooks, etc...
What goes in it is left to the discretion of the user or system
manager. See the file `site.sl' for examples.

     If you intend to use characters with ASCII codes greater than 127,
     it is important to read the section on "Eight Bit Clean Issues" in
     order to install JED in an 8 bit clean manner.

   When loading `site.sl' as well as other `S-Lang' files (the user's
personal initialization file, `.jedrc' or `jed.rc', is a special case,
see below), JED searches all directories specified by the environment
variable `JED_LIBRARY', and if the file is not found, JED will look for
it in the default directory. The environment variable `JED_LIBRARY' is
a comma separated list of directories.  Here are some examples of
setting this variable for different systems:

            VMS:   define/job JED_LIBRARY  dev$lib:[jedfiles]
           UNIX:   setenv JED_LIBRARY '/usr/local/lib/jed,~/jed'
          IBMPC:   set JED_LIBRARY = c:\editors\jed\lib

You will probably want to put define `JED_LIBRARY' in your login
startup file, e.g., `autoexec.bat', `login.com', or `.cshrc'.

   JED versions 0.92 and later allow the value of `JED_LIBRARY' to be
specified at compile time an it may only be necessary to define
`JED_LIBRARY' as an environment variable to override its pre-compiled
value.


File: jed.info,  Node: Startup Files,  Next: Starting JED,  Prev: Installing JED,  Up: Top

Startup Files
=============

   Once JED has loaded the startup file `site.sl', it will try to load
the user's personal initialization file.  It first looks in the
directory pointed to by the environment variable `JED_HOME'. If that
fails, it then searches the `HOME' directory and upon failure simply
loads the one supplied in `JED_LIBRARY'.

   The name of the user initialization file varies according to the
operating system.  On Unix systems this file must be called `.jedrc'
while on VMS and MSDOS, it goes by the name `jed.rc'.  For VMS systems,
the `HOME' directory corresponds to the `SYS$LOGIN' logical name while
for the other two systems, it corresponds to the `HOME' environment
variable.

   The purpose of this file is to allow an individual user to taylor
JED to his or her personal taste.  Most likely, this will involve
choosing an initial set of keybindings, setting some variables, and so
on.


File: jed.info,  Node: Starting JED,  Next: Emulating Other Editors,  Prev: Startup Files,  Up: Top

Starting JED
============

   Normally, JED is started as

         jed FILENAME
   or
         jed FILE_LIST.
   However, JED also takes the following switches:

`-batch'
     run JED in batch mode.  This is a non-interactive mode.

`-n'
     do not load `jed.rc' (`.jedrc') file.

`-g N'
     goto line N in buffer

`-l FILE'
     load FILE as `S-Lang' code.

`-f FUNCTION'
     execute S-Lang function named FUNCTION

`-s STRING'
     search forward for STRING

`-2'
     split window

`-i FILE'
     insert FILE into current buffer.

For example, the command line:
                     jed slang.c -g 1012 -s error -2 file.c -f eob

will start up JED, read in the file `slang.c', goto line 1012 of
`slang.c' and start searching for the string `error', split the window,
read in `file.c' and goto the end of the file.

   If the `-batch' parameter is used, it must be the first parameter.
Similarly, if `-n' is used, it must also be the first parameter unless
used with the `-batch' parameter in which case it must the second.  JED
should only be run in batch mode when non-interactive operation is
desired.  For example, JED is distributed with a file, `mkdoc.sl', that
contains S-Lang code to produce a help file for functions and
variables.  In fact, the help file `jed_funs.hlp' was created by
entering

                     jed -batch -n -l mkdoc.sl

   at the command line.

   Now suppose that you want to read in a file with the name of one of
the switches, say `-2'.  How can this be done?  The answer depends upon
the operating system.  For unix, instead of `jed -2', use `jed ./-2';
for VMS, use `jed []-2'.  The case for MSDOS is similar to unix except
that one must use the backslash.

   It is possible to completely change JED's command line syntax
through the use of the user defined function `command_line_hook'. In
fact, the behavior described above is dictated by the value of
`command_line_hook' as distributed in `site.sl'.  See the section on
hooks for details.


File: jed.info,  Node: Emulating Other Editors,  Next: File Types and Sizes,  Prev: Starting JED,  Up: Top

Emulating Other Editors
=======================

   JED's ability to create new functions using the S-Lang programming
language as well as allowing the user to choose key bindings, makes the
emulation of other editors possible.  Currently, JED provides
reasonable emulation of the Emacs, EDT, and Wordstar editors.

* Menu:

* Emacs Emulation::
* EDT Emulation::
* Wordstar Emulation::


File: jed.info,  Node: Emacs Emulation,  Next: EDT Emulation,  Prev: Emulating Other Editors,  Up: Emulating Other Editors

Emacs Emulation
---------------

   Emacs Emulation is provided by the S-Lang code in `emacs.sl'. The
basic functionality of Emacs is emulated; most Emacs users should have
no problem with JED.  To enable Emacs emulation in JED, make sure that
the line

                               "emacs.sl"  evalfile pop

is in your `jed.rc' (`.jedrc') startup file.  JED is distributed with
this line already present in the default `jed.rc' file.


File: jed.info,  Node: EDT Emulation,  Next: Wordstar Emulation,  Prev: Emacs Emulation,  Up: Emulating Other Editors

EDT Emulation
-------------

   For EDT emulation, `edt.sl' must be loaded.  This is accomplished by
ensuring that the line

                                "edt.sl"     evalfile pop

is in present in the `jed.rc' (`.jedrc') Startup File.  JED is
distributed with EDT emulation enabled on VMS and Unix systems but the
above line is commented out in the `jed.rc' file on MSDOS systems.

   This emulation provides a near identical emulation of the EDT keypad
key commands.  In addition, the smaller keypad on the newer DEC
terminals is also setup.  It is possible to have both EDT and Emacs
emulation at the same time.  The only restriction is that `emacs.sl'
must be loaded before `edt.sl' is loaded.

   One minor difference between JED's EDT emulation and the real EDT
concerns the  key.  EDT normally binds this to move the cursor to the
beginning of the line.  However, JED uses it as a help key.
Nevertheless, it is possible to rebind it.  See the section on
rebinding keys as well as the file `edt.sl' for hints.  Alternatively,
simply put
                            "^H" unsetkey "bol" "^H" setkey
   in the `jed.rc' startup file after `edt.sl' is loaded.  Keep in mind
that the  key will no longer function as a help key if this is done.

   EDT emulation for PCs only work with the enhanced keyboard.  When
`edt.sl' is loaded, a variable `NUMLOCK_IS_GOLD' is set which instructs
JED to interpret the numlock key on the square numeric keypad to
function as the EDT GOLD key.  In fact, this keypad should behave
exactly like the keypad on VTxxx terminals.  The only other problem
that remains concerns the + key on the PC keypad.  This key occupies
two VTxxx key positions, the minus and the comma (delete word and
character) keys.  Thus a decision had to be made about which key to
emulate.  I chose the + key to return the characters ` O l' which JED
maps to the delete character function.  This may be changed to the
delete word function if you prefer.  See the file `edt.sl' for details.

   The GOLD-GOLD key combination toggles the keypad between application
and numeric states.  On the PC, this is not possible. Instead, the PC
F1 key has been instructed to perform this task.


File: jed.info,  Node: Wordstar Emulation,  Prev: EDT Emulation,  Up: Emulating Other Editors

Wordstar Emulation
------------------

   `wordstar.sl' contains the S-Lang code for JED's Wordstar emulation.
Adding the line
                                "wordstar.sl"     evalfile   pop
   to your `jed.rc' (`.jedrc') startup file will enable JED's Wordstar
emulation.


File: jed.info,  Node: File Types and Sizes,  Next: Backup and Autosave Files,  Prev: Emulating Other Editors,  Up: Top

File Types and Sizes
====================

   JED is primarily a text editor; however, it can also edit binary
files (see the section on editing binary files).  As a result, JED may
edit lines of arbitrary length (actually this depends upon the size of
an integer).  It is capable of editing arbitrarily large buffers as
long as there is enough memory for the buffer as well as the overhead
involved.  This editor employs a linked list representation; hence, the
overhead can be quite high.


File: jed.info,  Node: Backup and Autosave Files,  Next: Status line and Windows,  Prev: File Types and Sizes,  Up: Top

Backup and Autosave Files
=========================

   On UNIX and MSDOS systems, JED creates backup files by appending a
`~' character to the filename.  The VMS operating system handles backup
files itself.  JED periodically autosaves its buffers.  On UNIX and
MSDOS, autosave files are prefixed with the pound sign `#'.  On VMS,
they are prefixed with `_$'.  The autosave interval may be changed by
setting the variable MAX_HITS to the desired value. The default is 300
"hits" on the buffer. A "hit" is defined as a key which MAY change the
state of the buffer. Cursor movement keys do not cause hits on the
buffer.

   Like many of JED's features, the names of autosave and backup files
can be controlled by the user.  The file `site.sl' defines two
functions, `make_backup_filename', and `make_autosave_filename' that
generate the file names described in the previous paragraph.  Like all
S-Lang functions, these functions may be overloaded and replaced with
different ones.  See also information about `find_file_hook' in the
section on hooks.

   On UNIX systems, JED catches most signals and tries to autosave its
buffers in the event of a crash or if the user accidently disconnects
from the system (`SIGHUP').

   If an autosave file exists and you is desire to recover data from the
autosave file, use the function `recover_file'.  Whenever JED finds a
file, it checks to see if an autosave file exists as well as the file's
date.  If the dates are such that the autosave file is more recent JED
will display a message in the minibuffer alerting the user of this fact
and that the function `recover_file' should be considered.


File: jed.info,  Node: Status line and Windows,  Next: MiniBuffer,  Prev: Backup and Autosave Files,  Up: Top

Status line and Windows
=======================

   JED supports multiple windows.  Each window may contain the same
buffer or different buffers.  A status line is displayed immediately
below each window.  The status line contains information such as the
JED version number, the buffer name, "mode", etc.  Please beware of the
following indicators:

`**'
     buffer has been modified since last save

`%%'
     buffer is read only

`m'
     mark set indicator.  This means a region is being defined

`d'
     file changed on disk indicator.  This indicates that the
     file associated with the buffer is newer than the buffer itself.

`s'
     spot pushed indicator

`+'
     undo is enabled for the buffer

`[Macro]'
     a macro is being defined.

`[Narrow]'
     buffer is narrowed to a region of LINES.


File: jed.info,  Node: MiniBuffer,  Next: Basic Editing,  Prev: Status line and Windows,  Up: Top

MiniBuffer
==========

   The MiniBuffer consists of a single line located at the bottom of the
screen. Much of the dialog between the user and JED takes place in this
buffer.  For example, when you search for a string, JED will prompt you
for the string in the MiniBuffer.

   The MiniBuffer also provides a direct link to the S-Lang
interpreter. To access the interpreter, press  ESC and the `S-Lang>'
prompt will appear in the MiniBuffer.  Enter any valid S-Lang
expression for evaluation by the interpreter.

   It is possible to to recall data previously entered into the
MiniBuffer by using the up and down arrow keys.  This makes it possible
to use and edit previous expressions in a convenient and efficient
manner.

* Menu:

* Command Line Completion::
* File Names::
* Buffer Name and File Name Completion::


File: jed.info,  Node: Command Line Completion,  Next: File Names,  Up: MiniBuffer

Command Line Completion
-----------------------

   The JED editor has several hundred built-in functions as well as
many more written in the S-Lang extension language.  Many of these
functions are bound to keys and many are not.  It is simply
unreasonable to require the user to remember if a function is bound to
a key or not and, if it is, to remember the key to which it is bound.
This is especially true of those functions that are bound but rarely
used.  More often than not, one simply forgets the exact name or
spelling of a function and requires a little help.  For this reason,
JED supports command line completion in the minibuffer.  This function,
called `emacs_escape_x', is bound to the key `ESC X'.  This is one
binding that must be remembered!

   As an example, suppose that you are editing several buffers and you
wish to insert the contents of one buffer into the the current buffer.
The function that does this is called `insert_buffer' and has no
default keybinding.  Pressing `ESC X' produces the prompt `M-x'.  This
prompt, borrowed from the Emacs editor, simply means that `ESC X' was
pressed.  Now type `in' and hit the space bar or the TAB key.  In this
context (completion context) the space bar and the TAB will expand the
string in the MiniBuffer up until it is nolonger unique.  In this case,
`insert_file' and `insert_buffer' are only two functions that start
with `in'.  Hence, `in' will expand to `insert_' at which point it
becomes necessary to enter more information to uniquely specify the
desired function.  However, in a completion context, the space bar also
has a special property that enables the user to cycle among the
possible completions.  For this example, hitting the space bar twice
consecutively will produce the string `insert_file' and hitting it
again produces the desired string `insert_buffer'.

   The role of the space bar in completion is a point where Emacs and
JED differ. Emacs will pop up a buffer of possible completions but JED
expects the user to press the space bar to cycle among them.  Both have
there pros and cons.  Frequently, one sees messages on the Usenet
newsgroup `gnu.emacs.help' from Emacs users asking for the kind of
completion JED employs.


File: jed.info,  Node: File Names,  Next: Buffer Name and File Name Completion,  Prev: Command Line Completion,  Up: MiniBuffer

File Names
----------

   JED takes every file name and "expands it" according to a set of
rules which vary according to the Operating System.  For concreteness,
consider JED running under MSDOS.  Suppose the user reads a new file
into the editor via the `find_file' command which emacs binds to  .
Then the following might be displayed in the minibuffer:

              Find File: C:\JED\SLANG\

Here JED is prompting for a file name in the directory \JED\SLANG on
disk C:. However, suppose the user wants to get the file
C:\JED\SRC\VIDEO.C. Then the following responses produce equivalent
filenames when JED expands them internally:

               Find File: C:\JED\src\video.c
               Find File: C:\JED\SLANG\..\src\video.c
               Find File: C:\JED\SLANG\../src/video.c

   Note that the on MSDOS systems, JED replaces the `/' with a `\' and
that case is not important.  Now suppose you wish to get the file
VIDEO.C from disk A:.  The following are also valid:

              Find File: A:\video.c
              Find File: A:video.c
              Find File: C:\JED\SLANG\a:\video.c

   In the last case, JED is smart enough to figure out what is really
meant.  Although the above examples are for MSDOS systems, the rules
also apply to unix and VMS systems as well.  The only change is the
file name syntax. For example, on VMS

              sys$manager:[misc]dev$user:[davis.jed]vms.c
              dev$user:[davis.jed]vms.c

become equivalent filenames upon expansion.  For unix, the following are
equivalent:

              /user1/users/davis/jed/unix.c
              /usr/local/src//user1/users/davis/jed/unix.c
              /usr/local/src/~/jed/unix.c

   Note the last example: the tilde character `~' always expands into
the users `HOME' directory, in this case to `/user1/users/davis'.

   When JED writes a buffer out to a file, it usually prompts for a
file name in the minibuffer displaying the directory associated with
the current buffer.  At this point a name can be appended to the
directory string to form a valid file name or the user may simply hit
the RET key.  If the latter alternative is chosen, JED simply writes
the buffer to the file already associated with the buffer.  Once the
buffer is written to a file, the buffer becomes attached to that file.

* Menu:

* Buffer Name and File Name Completion::


File: jed.info,  Node: Buffer Name and File Name Completion,  Prev: File Names,  Up: MiniBuffer

Buffer Name and File Name Completion
------------------------------------

   When JED prompts for a file name or a buffer name, the space bar and
the TAB keys are special.  Hitting the TAB key will complete the name
that is currently in the minibuffer up until it is no longer unique.
At that point, you can either enter more characters to complete the
name or hit the space bar to cycle among the possible completions.  The
spacebar must be pressed at least twice to cycle among the completions.

   On MSDOS and VMS, it is possible to use wildcard characters in the
file name for completion purposes.  For example, entering `*.c' and
hitting the space bar will cycle among file names matching `*.c'.
Unfortunately, this feature is not available on unix systems.


File: jed.info,  Node: Basic Editing,  Next: Modes,  Prev: MiniBuffer,  Up: Top

Basic Editing
=============

   Editing with JED is pretty easy-- most keys simply insert themselves.
Movement around the buffer is usually done using the arrow keys or page
up and page down keys.  If `edt.sl' is loaded, the keypads on VTxxx
terminals function as well.  Here, only the highlights are touched upon
(cut/paste operations are not considered "highlights"). In the
following, any character prefixed by the `^' character denotes a
Control character.  On keyboards without an explicit Escape key,
Control-[ will most likely generate and Escape character.  The
following list of useful keybindings assumes that `emacs.sl' has been
loaded.

`'
     redraw screen

`'
     Undo  (Control-underscore, also  u)

`ESC q'
     reformat paragraph (wrap mode)

`ESC n'
     narrow paragraph (wrap mode)

`ESC ;'
     Make Language comment (Fortran and C)

`ESC \'
     Trim whitespace around point

`ESC !'
     Execute shell command

`ESC $'
     Ispell word (unix)

` ?'
     Show line/column information

``'
     `quoted_insert' -- insert next char as is (backquote key)

`ESC s'
     Center line

`ESC u'
     Upcase word

`ESC d'
     Downcase word

`ESC c'
     Capitalize word

`ESC x'
     Get M-x minibuffer prompt with command completion

` '
     pop up a list of buffers

` '
     exit JED

` 0'
     Delete Current Window

` 1'
     One Window

` 2'
     Split Window

` o'
     Other window

` b'
     switch to buffer

` k'
     kill buffer

` s'
     save some buffers

`ESC .'
     Find tag (unix ctags compatible)

`X     Set Mark (Begin defining a region)

* Menu:

* Undo::
* Marking Text (Point and Mark)::
* Tab Issues.::
* Searching::
* Rectangles::
* Sorting::


File: jed.info,  Node: Undo,  Next: Marking Text (Point and Mark),  Up: Basic Editing

Undo
----

   One of JED's nicest features is the ability to undo nearly any change
that occurs within a buffer at the touch of a key.  If you delete a
word, you can undo it.  If you delete 10 words in the middle of the
buffer, move to the top of the buffer and randomly make changes, you
can undo all of that too.

   By default, the `undo' function is bound to the key  (Ascii 31).
Since some terminals are not capable of generating this character, it
is also bound to the key sequence  u.

   Due to the lack of virtual memory support on IBMPC systems, the
`undo' function is not enabled on every buffer.  In particular, it is
not enabled for the `*scratch*' buffer.  However, it is enabled for any
buffer which is associated with a file.  A "plus" character on the left
hand side of the status line indicates that undo is enabled for the
buffer. It is possible to enable undo for any buffer by using the
`toggle_undo' function.


File: jed.info,  Node: Marking Text (Point and Mark),  Next: Tab Issues.,  Prev: Undo,  Up: Basic Editing

Marking Text (Point and Mark)
-----------------------------

   Many commands work on certain regions of text.  A region is defined
by the `Point' and the `Mark'  The `Point' is the location of the
current editing point or cursor position.  The `Mark' is the location
of a mark. The mark is set using the `set_mark_cmd' which is bound to
`^@' (Control-2 or Control-Space on some keyboards).  When the mark is
set, the `m' mark indicator will appear on the status line.  This
indicates that a region is being defined.  Moving the cursor (`Point')
defines the other end of a region.  Many editors will highlight the
region as it is marked.  I have not added this to JED since such a
feature complicates the display code without contributing any useful
functionality.  Of course this is only my opinion and is open for
debate.

   It is easy to see where the location of the mark is by using the
`exchange' command which is bound to  .  This simply exchanges the
`Point' and the `Mark'.  The region is still intact since it is defined
only by the `Point' and `Mark'.  Pressing   again restores the mark
and Point back to their original locations.  Try it.

