## 4 Starting JED

Normally, jed is started as

         jed <file name>

or

         jed <file list>

However, jed also takes the switches defined in the following table:

         Switch          Meaning
         ------          -------
          -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 MS-DOS 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.