This README is part of the jot text editor installation.
<P>To view the jot documentation package point your browser at:</P> <P>${JOT_HOME}/docs/jot_ug.html</P> <P>This has links to other files in the jot documentation suite.</P> <P>Alternatively, if you have a working jot installation, try this:</P>
$ jot /dev/null -st=qr
<P>in windowsland this should work:</P>
$ jot NULL -st=qr
<P>This loads the documentation .txt files, resolves and displays the links allowing you to click through links.</P>

Installation - general

The contents of the jot_v<ver>.zip or jot_v<ver>.tz archives is identical, these are available from the JoyOfText project at sourceforge.net the installation procedure is as follows:

The installed tree looks a bit like this:

                   v<version>                                  
                       |                                    
    ---------------------------------------------                  
   |      |      |                  |            |                  
  bin    coms   releasenote.txt    resources    source                     
   |      |                         |            |
   |     ...                       ...          jot.c 
   |
   ------------------------------------------------------------
   |      |        |       |          |          |             |
  lin64  win      armv7l  test.csh   test.bat   test_win.csh  test_win.bat          
   |      |        |
  jot    jot.exe  jot

Also, some functions require data files that might not be appropriate to share with the world at large, so there's another env JOT_RESOURCES that points to a place where these can be picked up. If, however, the JOT_RESOURCES env is not set up then it just defaults to ${JOT_HOME}/resources which is OK for now.

See also Manual setup

Environment

There are some environmental variables to be set up:

In linux these can be set up with an appropriate entry in your .bashrc, your .cshrc or whatever the run-control script is for your shell.

In windows, the envs are set up by adding a couple of registry entries.

For both linux and windows this setup are performed by the relevant install script (install.sh or install.bat respectively), these scripts can be found in ${JOT_HOME}/bin

Installation - linux

Download either the .tz tarball or the .zip file, the contents of both are identical. In the first instance you might decide to unpack to somewhere in your home area. A better place for a permanent installation might be /usr/share/jot. If you opt for somewhere below /usr you will need a personal resources file somewhere below your home area maybe ~/jot/resources. Users of the bash shell will need something similar to the following lines in their .bashrc files:

export JOT_HOME=<installationPath>
export JOT_RESOURCES=~/<resourcesPath>
export PATH=$PATH:<installationPath>/bin/lin64  (there's also a lin32 branch)
export XTERM_LOCALE=C.UTF-8

If JOT_RESOURCES is not defined, it will default to ${JOT_HOME}/resources.

Installation - Windows NT

Download the jot<version>.zip and unpack with your favourite unzipper. The conventional place for a permanent windowsland installation is C:\Program files\... - anyway it's your computer - park it where-ever you fancy.

In windowsland registry entries are the recommended way of setting up envs but oh! - life's so short and there are so many more exciting things to be doing rather than regedit mud wrestling. To just test and play around with the unpacked installation:

$ setx JOT_HOME=C:\<unpackPath>\v<version>\
$ setx JOT_RESOURCES=C:\users\<userName>\
$ set PATH=C:\<unpackPath>\v<version>\bin\win;%PATH%

If JOT_RESOURCES is not defined, it will default to %JOT_HOME%\resources.

Getting Started

Fire up the editor in an xterm (or windows console) - the following command line will work in either linux or windows:

$ jot ${JOT_HOME}/resources/Richard_III_Entire_Play.txt

In windowsland, the ${JOT_RESOURCES} element is passed to jot unchanged, jot will always resolve any pathname containing references to envs wrapped up in ${ and }.

You should see the first few lines of Shakespeare's Richard II in the window. There should be a reverse-video line near the bottom - the delimiter line showing the pathname of the file you're looking at and, near the right margin, a full stop ( . ) - in jot all buffers are identified by a single character the main buffer is always ( . ).

Below the delimiter line is the console area - four lines containing various messages and a prompt. Right now there are lines of three messages generated as jot fired up - details of scripts the startup script ran and the version and build date of the jot executable you're running.

The prompt also contains two useful bits of information the line number of the current line ( 1 in this case) and the buffer key ( . ).

Notice also there's two cursors:

Those who old enough to remember them will deduce from this that jot is a command-driven editor. Many thought the species extinct but no - it's alive and well.

This is good news for anyone who likes to get their hands dirty and write their own little bits of code. Maybe to automate some operation or to locate some highly-specific context in the text. There is no requirement to do any special wriggling - just type your command sequence straight into the console area, hit {return} and the editor gets on with it right away.

Let's do a string search - type the string king then hit the F8 function key:

> king{F8}

the first thing to notice is that the function key doubles up as a string terminator - this is good news for typists of limited ability as well as those susceptible to typists cramp.

Next notice that the cursor has moved down a few lines (line 29 according to the prompt) and it's now sitting over the ( k ) in "looking-glass" and that the following three letters are underlined. This indicates that it's selected the substring ( king ) and the current character is the ( k ).

Now hit F8 again.

> {F8}

first notice that that {F8} without any parameter string will search for the last-searched string and that jot. Now hit F8 again and it goes to the word "King" - and so we note that, by default, jot searches are case insensitive.

The F7 function key searches back towards the start of the file image:

> {F7}

the cursor is once again showing the substring ( king ) on line 48. Another takes us back to line 29, one more fails with the message:

> {F7} > {F7} {Command-sequence failed.}f-

notice that the jot cursor has moved to the first line of the file, this is blank, so the cursor shows a tilde ( ~ ) in reverse video - this is jot's way of saying the cursor is at the end of the line.

The cursor-control keys work pretty-much as for any text editor except that the up and down arrow keys go to the start of adjacent lines making no effort to hold to a column. For most applications this behaviour is preferable but there are ways of holding to a column when required.

The left and right-arrow keys, when combined with the shift key will move left or right by one word at a time. Combining the shift key with up or down-arrow keys move up and down in a column.

With documents like this it's quite handy to navigate up and down paragraphs {F3} and {F4} will move, respectively, to the start of the previous and the start of the next paragraph.

Now one important implication of jot being a command-driven editor is that there has to be an explicit command to enter each new line of text into the document. The escape sequence {Esc e} (Enter) enters a line of text immediately below the current line of text. First hit {F8} again - we're back to line 29 and enter a new line:

> {F8} > This is a line of text I've just typed in myself.{Esc e}

Sure enough, we've added a new line of text to a Shakespeare play, notice that the new line has inherited the same indentation level as the previous line.

Another important command you will now need to know is how to exit the editor - it's %a - no need to ask why.

> %a{return}

For a more comprehensive introduction to jot take a look at ${JOT_HOME}/docs/jot_walkthrough.txt - first start the quick-reference viewer:

$ jot /dev/null -st=qr

Go to the end of the document:

> m0

At the very end of the file, you should see "jot walkthrough training course" highlighted in green, a left-button mouse click here will take you to the start of the walkthrough.

Executables

The downloaded windows executable is statically linked to gnu libs and should work for any recent NT windows. The linux versions are statically linked to ncurses and dynamically linked to the remaining linux libs. The objective of the static linking is to make these executables a bit more portable. This is not an issue if you're recompiling.

Compilation (Linux/Unix)

Compilation in a gnu environment (dynamic linking to ncurses):

$ cd $JOT_HOME
$ versionString="jot <version>, built `\date +%d/%m/%y\ %H:%M:%S` `\uname -nspr`  "
$ gcc -g source/jot.c -D VERSION_STRING="${versionString}" -lncursesw -o jot |& tee jot.lis

Expect no warnings or errors.

Compilation: MS-Windows

The original was compiled using MSVC 2010 (the express version) under wine, using both MS and gnu libs. To compile locally you will require the following:

There was one warning about a macro redefinition in cdefs.h (in libgw32c-0.4).

The following directory structure was used to compile in windows and wine:

    ------
   |      |  
  source wine
   |      |
  jot.c    -----------------------------------        
          |                            |      |            
         libgw32c-0.4                 MSDKs  lib           
          |                            |      |            
           -----------------          Lib    libgcc.lib    
          |                 |          |      |            
         lib               include    ...    ...           
          |                 |                                                 
         libgw32c.a        glibc                                              
                            |                                                 
                           search.h                               

With VC express 2010 jot builds with the following commands:

$ cd $JOT_HOME
$ cl /c /DVC /D__value=_value /Zi /D_DEBUG /DVERSION_STRING="jot <version>, <hostInfo>, <dateStamp>, for WindowsNT" source/jot.c
$ link /debug /out:jot.exe jot.obj wine/libgw32c-0.4/lib/libgw32c.a wine/MSDKs/v7.1/Lib/*.Lib wine/lib/libgcc.lib