JOT User Guide

This is a guide aimed at those who just want to find out how to use an editor that works. A more detailed technical guide can be found at jot technical guide and the Jot Quick Reference or, for real-life examples, there's jot examples.

The bulk of this guide consists of descriptions of the various functions defined in the normal startup.jot script (in ${JOT_HOME}/coms/startup.jot). All of these functions are are held in the code-repository buffer ( * ) and most are designed to be invoked by an escape sequence mediated by the key-code buffer ( ^ ), the descriptions of such functions also have details of the escape sequence. Others are secondary functions designed to be called by other functions in the startup script (the proximity search functions, for example, have several secondary functions).

For details of jot primitive commands see JOT primitive commands.

Description of the Editor

Jot is a command-driven text editor with a modern viewer and a simple concise language. Although a command-driven editor, that doesn't mean you have to type loads of long-winded code every time you want to do the simplest thing. There's loads of key bindings and escape sequences for doing most of the usual editor actions.

If, however, it's a complicated thing you want to do, the jot language is terse and powerful so it's not like trying to excavate the Panama canal with a teaspoon - you can make your own steam-shovel and have the work done in no time using little sequences of jot code.

Backstory

The jot editor owes much to the Edinburgh Compatible Context Editor (ECCE). ECCE was designed back in the days of teletypwriters and consequently has a somewhat old-fashioned look and feel compared to editors designed for modern video terminals.

What ECCE does have is a terse, easy and, above all, powerful command language. This language forms the basis of jot - see the basic commands section for details.

What is a text editor and why should I want one?

Modern computers have a filing system holding a great many files. Many could be described as system files - they control how the computer is set up at the start of day. Others are our files files containing our information - notes, letters emails, to-do lists accounts, spreadsheets ...

Many files are binaries - meaningful to the computer but incomprehensible gobbledygook to you and me but many files are plain text. Some are even written in natural languages like English.

Looking at the computers system files, some are primary setup files, written by someone for the computer to read. Others are computer-generated log-files and some are intermediate data files written by the computer and intended to be read by the computer but available to us to look at and, if we think we know what we're doing, change their content. Where these files are in plain text it is because it was deemed important that, even though it might have been easier to write this information in some sort of binary code, it would be helpful if we humans could also read them, try to make sense of them and, maybe, fix problems with the setup.

A text editor is an essential tool wherever there is a need to study or change these text files. In a dire emergency, jot can also be used to change binary files but this is not a recommended everyday usage - see editing binaries.

Many windows users will have encountered notepad - this an editor with a simple command structure that can search for a substring, substitute some other substring, to do a global search & replace and, er, that's about it. Often we have an enormous file with thousands of simple substring matches but only a minority match some more detailed context specification. To find instances of real interest, we've either got to manually wade through thousands of potential matches or switch to an editor with better context-matching.

A common feature of all modern editors is that they display text in a window on the computer screen with a cursor showing the current focus. They also obey simple instructions to alter the text and to change the focus in the text - typically with the cursor-control keys (Up, Down Left, Right, Page Up and Page Down). They can search the text for specified combinations of characters (strings), insert new text strings, erase and substitute strings. The better editors can do all this and much, much, more.

Starting jot

jot is normally started by entering a suitable command to a CLI (Command-Line Interpreter) - either a unix shell or a windows Console (formerly known as an MS-DOS prompt window).

$ jot <pathName>

The standard startup script (startup.jot) will set up a viewing area covering the entire screen except for the last two lines.

There are several command-line qualifiers. Should you type in an incorrect pathname, or no pathname at all, the editor will start but jot will set the pathname to:

If, what you actually wanted to do was to start typing in a new file then the -new qualifier will set up your session correctly.

Equally important are the commands for exiting jot:

About the current character and substrings

The editor places a special marker, the cursor, in the text to indicate it's current focus. This is the point where text might be inserted or the start point for searches.

On completion of a successful find, verify, substitution or insertion (see F, V, S and I commands). The relevant substring is highlighted on the screen and, internally, some special pointers are set up). Some subsequent substitute command can then replace the currently-selected substring with some new substring - see also %U. Also the selected substring can be set by the ou stack operation.

Any command that involves moving the current character pointer will remove this highlighting and reset the internal pointers.

The current-character cursor is displayed in reverse video. This cursor reflects the state of internal current-record and current-character pointer. This is allowed to go one character position past the end of the line. At this point there is no character to highlight. When this happens, a tilde ( ~ ) is displayed at the end of lines to indicate this situation.

Some may wonder why the cursor is allowed to go past the end of the real text. Well fear not for it's all been thought about. By allowing the cursor to go past the line end, jot avoids the necessity for special flavours of commands operating at and after the current character. Eg. jot has only one insert command ( I ) which inserts before the current character and there's no need for a magic mode or another command to insert after the current character.

When a substring has been selected (e.g. by a find command) the substring is displayed with underscores with the current character in reverse video. Of the commands which define a substring, some leave the cursor at the start of the substring (e.g. find - see F) others leave it at the end. For these commands the current character is the character immediately following the substring (e.g. insert I).

In tty mode (see -tty) the editor cannot control the display and the current line is printed and below it the carat character ( ^ ) indicates the current character, and tildes ( ~ ) indicate the currently-selected substring. This scheme is useful when you only have a simple connection to jot running a remote computer (i.e. ssh is not available) - or if you are using a genuine teletypewriter.

About words, lines, phrases, sentences, paragraphs, sections and chapters

Most text files are structured in some way. Many are written in natural languages structured in words, lines, phrases, sentences, paragraphs, sections and paragraphs. Machine-readable text and machine-generated reports are similarly structured but into more formal units e.g. code-sections, modules and expressions.

The jot startup script defines several functions that operate on words presented in the familiar context of phrases, sentences, paragraphs, pages and chapters. There are some additional structures designed to simplify searches in large formal machine-generated and machine-readable documents - these are named sections and blocks and approximate to natural languages paragraphs.

These structures are important for the proximity-find functions (see the proximity search functions) they are also useful for simple navigational tasks - e.g: ParagraphUp and ParagraphDown move the focus to the start and end of the current paragraph.

jot recognises the following sections and operates on them with the listed functions:

Hopefully everyone comfortable the concept of words, phrases, sentences etc in the context of natural languages. For the benefit of scientific and engineering usage, the definition of a word has been stretched from simple strings of alphabetical characters, meaningful in natural languages; to include also digits and underscore ( _ ) characters.

Where the function has to identify words from other characters such as punctuation marks or operators separating identifiers in an expression, it uses the Q command. for most purposes it defines a word to be a string of the following character classes separated by some other ASCII characters:

The {Word|Paragraph|Chapter}{Left|Right|Up|Down} functions are simple navigation functions and do pretty-much what it says on the tin.

The {Delete|Restore}Word{Left|Right} functions move words and part words between the current buffer and the delete-bin buffer ( % ).

The ReformatParagraph, MakeParagraphIntoBullet and SpellcheckParagraph are dedicated to document preparation - see text document preparation.

If your system has aspell installed (see installation) then the SpellcheckParagraph function will pass a copy of the current paragraph through Aspell and will display the results.

About key bindings and escape sequences

The key bindings are set up at startup time. Many of the most basic editing functions are bound to function and navigation (i.e. left/right-arrow, up/down-arrow, Page-up/Down ...) keys. Additional functions are available by combining these keys with {Alt}, {Shift} and {Ctrl} keys. These mappings are described in jot quick reference.

For example, whereas the {RightArrow} is obviously bound to a function that sends the cursor one character rightwards, {Shift+RightArrow} sends it one word rightwards and {Ctrl+RightArrow} sends it to the rightmost end of the line. Combining these with the {Alt} key deletes characters, words and lines respectively. It's a similar story for the other cursor control keys. Also {Ctrl+Shift+<arrowKey>} shifts the view in the viewing window.

While the assignment of key bindings and escape sequences strives to be as memorable and consistent as possible, it doesn't always work out like that To avoid name collisions in the two-character name space, a less obvious pair might have to be used. The function FindSequence, for example, is assigned {Esc f q}, it might otherwise be assigned the sequence {Esc f s} but that one's assigned to another function ProximitySentence.

Many functions are bound to escape sequences. In an attempt to make the escape sequences more memorable they follow a simple convention:

Examples of escape-sequence groupings:

There's a full list in the quick-reference guide at escape sequences.

Navigation by context

There are several options available for searching or navigation by context. This is an essential element in any text editor - in response to some search specification, the editor changes focus to some place matching the search specification in some way.

The proximity search functions

When working with a really big text document, one of the things we may want to do is search the file for specific bits of text. Well any text editor will do that but, it's a very big file remember and we're looking some specific context involving commonly-occurring words. Depending on the size of the file and the search string, there could be quite literally millions of matches and we don't want to be checking them all manually. What might help is a form of search that identifies, say, paragraphs containing some combination of words where, even if all of the words are quite common, that particular combination is only likely in the paragraph containing the information we seek.

The jot proximity functions will search for paragraphs matching a specific logical expression combining words (or any substrings) and logical expressions (i.e. ANDs, ORs and NOTs). These are proximity expressions and they're not limited to paragraphs the proximity aperture may be any of the following (see About words, lines, phrases, sentences, paragraphs, sections and chapters):

Fortunately, most of the big documents we might want to search are structured in some way. Typically, natural language text might be organized into phrases, sentences, paragraphs, blocks and chapters. Thus there are functions for finding matches within boundaries set by these natural-language structures.

The aperture is implied by the function name - function names with the "Back" suffix search backwards:

The first argument to the proximity function is an optional multiplier, followed by the proximity expression. As usual with jot these are entered ahead of the escape sequence. Here's a few examples:

> (tom & piper & pig) {Esc f s}

Proximity Expressions

The simplest proximity expression is a list of substrings, typically words, separated by ampersands ( & ) - this arrangement specifies that all of the substrings should be present in the matching block of text.

However, it is frequently the case that we need to specify something a bit more complicated - we may want to specify alternatives to some words or indicate some words whose presence should cause a match to be rejected. For these cases we use canonical expressions these may be:

Examples of valid search expressions:

See also Using the Context-Proximity functions

Command-mode vs. insert mode

Whereas, in command mode, editors pick up a command and a parameter, generally, terminated by {Return} in insert mode, your typing appears in the text image at the cursor, which generally moves rightwards with each new character.

Which of these two contrasting modes of operation is better? Well, sometimes we're doing a brain-dump to text at other times we're picking our way through some preexisting file, analyzing it and, maybe, modifying it. for the former type of operation we're maybe better off using insert-mode, for the latter the command-driven approach has advantages.

Many modern text editors and virtually all word processors operate in a permanent insert mode - typing at the keyboard appears directly in the text image. Frequently there is not even a temporary command mode and the unfortunate user is obliged to interact with their editor using some menu-based GUI.

Many editors, including jot, offer a means of switching between their insert and command mode of operation. A few, jot included, offer a full range of services in either mode. For jot, command mode is the default. This can be changed using the InsertMode and TempInsertMode functions or the default can be changed in the startup.jot file by adding a suitable %s=commandmode line.

About help

The jot help system is based on fold marks - a sequence of three open braces ( {{{ ) at the start of a line is a fold start, a sequence of three close braces ( }}} ) is a fold-end mark. Folds can be nested to any level.

Another type of fold mark is the file-fold mark - these take the following form:

[<pathstub>]<filename>

The pathstub is a subpath in the filing system starting at the path of the current file fold (typically ${JOT_RESOURCES}/help/... ) and the file <filename>.hlp must exist in this directory. When opened the file is merged into the help repository.

The Help function (normally attached to {F1}) looks at the current line in the display.

About command editing

Jot is a command-driven text editor so it should be pretty good at editing it's own command language right? Er ... well maybe.

The problem is that it's not easy to define a syntax for commands to be used for editing the same commands for the same command console of the same system.

Suppose, for example, we wanted to fix up the sort of command-line editing provided by most CLI shells. Even limiting it's scope to just the four cursor-control keys the delete key reveals some pretty horrendous syntactic problems for a text editor editing the text requires the same cursor-control operations as the command-editing operations.

One could, for example, provide a complete set of editing functions that only apply to the command line - that's unlikely to catch on as we would have to learn a completely new set of commands just to edit standard commands. We could devise some magic mode where the cursor keys etc. operate on the command line rather than the text buffer - well that's a possibility but magic modes are unlikely to be popular and it does increase the complexity of the editor.

The approach adopted by jot does not involve a magic mode but it works, instead, by switching to a buffer containing the recent command history with all normal editing functions operating normally. And there's a pair of functions, one dedicated to setting up this buffer and one to return to the original buffer.

The standard startup script defines two functions for command editing - CmdEditStart and CmdEditGo.

CmdEditStart ( {Esc c e} ) acquires a list of recent commands and whatever you've been typing to the console area and displays this in a temporary buffer. In this view you can use normal editing functions to select and, if required, modify a command string.

When the selected command has been suitably modified, use CmdEditGo ( {Esc c g} ) push your selected and edited command string back into the console buffer, ready for you to use in whatever way you fancy.

The editor maintains an internal history log containing the last few commands. By default this holds the last 20 commands but this limit can be changed with the -history CLI qualifier.

Note that the command history is viewed and edited in the ( - ) buffer. Now one other function also uses the ( - ) buffer - <<AddNewFunctions>> hence you avoid using this function while editing commands. In practice this restriction should not prove overly burdensome since that function is only used by scripts to add new functions to the code repository.

About not losing your work

There are many and varied ways of mistakenly losing or corrupting work in an editing session - jot offers a few ways of making this a bit less easily:

Where one of the attribute-setting approaches is relevant, to ensure this *always* gets done, add these commands to your project-area startup.jot file

Made a mistake?

Jot lacks an undo facility so, changes you chose to make are likely to stay changed and jot offers hundreds of ways of corrupting files it's an editor of great power for both good and ill.

Now some mistakes are fairly easy to rectify - in many instances all that's happened is that a delete left/right function has deleted some text and the text is now sitting in the delete buffer ( % ) and can be restored by holding down {Ctrl+Alt+Shift+Left|RightArrow} - see RestoreChrLeft and RestoreChrRight.

But sometimes some complicated macro has not performed as required and we'd like to wind back history. The recommended method of dealing with this situation is to generate a recovery file and, before running it, remove the bad operation - see undoing changes for details.

About multi-window working

Jot allows the usable screen area to be allocated to any number of areas known here as windows. The screen may be split horizontally or vertically to create displays of some complexity by repeatedly using the %W command. The range of window types available using functions defined in the startup script is more limited - a simple one-window display, screen split into any number of equal-sized horizontal strips or the screen split into any number of equal-sized vertical slices.

The WindowOne function gives a simple single-window display, the WindowHorizSplit and WindowVertSplit will split the screen.

Various functions operate on specific windows eg: WindowReassign, WindowStretch and WindowShrink - when there is more than one screen these functions need to identify the window to be adjusted.

Windows are allocated a window number - this number appears in query screen reports at the start of each window-description line. Alternatively, you can just count windows from 0, starting from the top-left of the screen working from left-to-right and then top-to-bottom.

Sometimes we might like to temporarily revert to simpler window configuration - but the current configuration might be difficult and or time consuming to restore manually. For this situation there are the WindowSave and WindowRestore functions. WindowSave records details of your current window configuration and then calls WindowOne to change to a basic single-window configuration and WindowRestore re-creates the original configuration.

About Highlights

Some functions apply highlights to your text in order to make certain bits stand out on the screen. This is mechanized by way of jot tags - little bits of metadata, (see about tagged text) and have no effect on the text when it is finally written back to the filing system. There are various colours available for both the foreground and background. The main purpose of highlights is to make particular bits of text easily identifiable, several functions and scripts either add or manipulate these:

Use NextHighlight and PrevHighlight to change focus to the next/previous section of highlighted text.

All text highlights are cleared by the WindowOne function.

About jot messages

Jot messages are an important precursor to successful diagnosis and rectification of programming and usage problems. These can be controlled by the %s=verbose command - essentially, apart from prompts, it keeps pretty quiet unless there's an uncaught failure.

There are five levels of jot messages

The verbosity vector, specified by %S=verbose controls what ends up on the screen - briefly, this is a bitmask, setting it to 3 (the default setting) gives you prompts and error messages, setting it to 7 gives you prompts, errors and warning messages. A setting of 7 is useful for debugging, experimenting and training but the messages soon become annoying.

The CLI arg -quiet has the effect of setting the verbosity vector to 0 at the start of the session this suppresses all prompts and messages including those normally emitted at startup time.

Most messages are in three parts:

About jot debugging

Jot supports a simple debugging environment. It is possible to display the current state of the stack, the current record and breakpoint on a number of predefined conditions - see the jot debugger, %S=trace and %s=tracedefault.

Typically, one might request a breakpoint, a stack dump and display of the current record at each trace point. With a trace point at every command or every new command line. It is also possible to put an explicit debugger request (the T command) in the command string.

When the trace vector specifies a breakpoint (see %s=trace), at each breakpoint dabbing the {Return} key will cause execution to continue to the next breakpoint (the next command if Trace_AllCommands is set, the start of the next command line if Trace_CommandLines is set ...).

By default, the DebuggerQuit function will reset the trace vector so that execution continues normally. If DebuggerQuit is given a numeric argument, it applies the argument to the %s=traceskip command. This causes execution to skip to the end of the selected block, macro, function or script.

The debugger is controlled by the following commands:

Note that line numbers reported in error messages etc. refer to lines in the code-repository ( ' ) buffer - not line numbers in your script. One simple way of dealing with this problem is to set the line numbers in your script to match those in the code repository. First identify a line from your script in the repository (buffer ( * ) ) and note it's line number (say 999). Then go to the same line in your script and set the line number thusly:

> ol999o.

Henceforth, all line numbers in warnings etc. will be in alignment with those in your source script. The linenumbers will go back to normal when you open a new editing session on your script so it is suggested that you keep the session open.

About line drawing

Jot offers some limited support for the creation of simple line-drawing diagrams, flow-charts electrical schematics etc.

The support consists of functions for drawing horizontal, vertical and diagonal lines, some some cursor positioning functions specific to line drawings and a block move function.

If, while drawing, an attempt is made to go above the top or below the bottom boundary of the buffer or there is an attempt to draw past the end of a line then additional lines and/or whitespace is automatically added.

By default jot will insert simple ASCII characters Hyphen ( - ), Vertical bar ( | ), Slash ( / ) and Backslash ( \ ) but the appropriate unicode characters are available as an option (

If the diagrams are to be part of a document to be processed by the document-preparation functions and scripts (txt2html.jot, doc2fold.jot and html2txt.jot) (see text document preparation) then it is important that the first character of each line in the graphical section begins with any character other than an ascii space - an ASCII VT (tab) will do.

It attempts to tidy corners when shifting between horizontal and vertical lines and similarly with diagonals. Hence a series of <<LineE>> followed by a <<LineS>> will remove the last hyphen ( - ) and replace it with whitespace. Diagonals join up tidily without extra whitespace but the drawing functions adjust the cursor position as appropriate e.g:

     ----      /\     \     ----                                  \
    |    |    /  \     \   |    |     \        /        /\          \
    |    |   /    \    /   |    |       \    /        /    \        /
     ----             /     ----          \/        /        \    /

    ┌───┐     ┏━━━━┓     ╔════╗ 
    │   │     ┃    ┃     ║    ║ 
    │   │     ┃    ┃     ║    ║ 
    └───┘     ┗━━━━┛     ╚════╝ 

The unicode characters are selected using the LineDefaultChrs function.

For details take a look at line-drawing functions:

Functions defined at startup and key bindings

The startup.jot script defines the functions described in the following sections.

In the description of functions dealing with paragraphs, a paragraph is deemed to be a block of lines bounded by completely blank lines - i.e. a line which does not even contain whitespace.

In the description of functions dealing with words, JOT defines a word as a string containing upper and lower-case alpha characters, digits and underscores. Unfortunately, at present, all unicode characters are treated as non-alpha characters.

The functions described here are defined by the startup.jot file which also links them to the keyboard, the keycodes are are defined in a separate file curses_keys_<version>.jot (linux) and WindowsNT_keys.jot (windows).

Help functions.

Jot help reads a top-level help menu at startup time. This is displayed on the first call for help. A help category is selected by navigating to a line, using the cursor-control keys and hitting the help button (normally F1) once more.

The initial help categories are file folds - they all have a pathname specification of the form [<path>]<name>, as the file folds are opened, the relevant file is read and it's top-level fold headings is displayed. The internal fold headings begin with '{{{' at the start of the line. These can be opened and descended into by navigating the cursor to them and hitting the help button again.

The help structure can be ascended by navigating to and non-fold line and hitting the help button once more.

Help

> [<helpQuery>]{F1}

Searches the help database for an entry with a name matching the helpKey - if no helpKey specified but the cursor is on a help fold the fold is opened if not on a help fold then the current help fold is closed - see about help.

FindAllHelp

> [<string>]{Shift+F1}

Searches the currently-opened help documents in the help repository (the : buffer) for matches with string, help menu is set up with matching entries.

RemoveHelpFold

> {Ctrl+F1}

The contents of the current fold is removed, if it's a file fold then the file-fold marker is restored.

Find, Substitute and Insert

Arguably the most basic of all editor functions are finding and replacing text F5 to F9 are used for these operations with a few special flavours obtained using the Shift, Ctrl and Alt keys.

FindNext

> [<string>]{F8}

Find the next occurrence of the specified string, if no string is specified then the string used in the last find is used.

Substitute

> [<string>]{F5}

Replaces currently-selected substring with the specified string, if no string is specified then the last-substituted or inserted string is used.

Remove

> {Shift+F5}

The previously-selected string (following a find, substitute etc.), is removed altogether.

SubstituteAgain

> {Alt+F5}

In insert mode, the Substitute function will always prompt for the search string. SubstituteAgain will just apply the last-used substitute-string parameter once again.

This function is provided for the benefit of insert-mode users as it repeats a substitution without re-prompting. It's entirely useless when in command mode - where it is only necessary to dab F5 again to repeat the substitution at some new location.

Insert

> [<string>]{F6}

Inserts specified text at the current-character position, if no string is specified then the last-substituted or inserted string is used.

Overwrite

> [<string>]{Shift+F6}

The characters under and to the right of the current cursor are replaced by the specified string. If no string is specified, then the last string used in an insert or substitute operation is used.

The overwrite function is useful when editing tabular data.

InsertAgain

> {Alt+F6}

In insert mode, the Insert function will always prompt for the insert string. InsertAgain will just apply the last-used insert-string once again.

This function is provided for the benefit of insert-mode users as it repeats an insert without re-prompting. It's entirely useless when in command mode - where it is only necessary to dab F6 again to repeat the insert at some new location.

InsertWithBackTick

> [<String>]{Esc ’}

The normal Insert function can insert any string that does not contain the ASCII backtick (or grave) character ( ’ ). That's because the Insert function uses this character as a delimiter to introduce the user-specified string. This is not usually a problem but, if it is, the InsertWithBackTick function is designed to fill that gap.

InsertWithBackTick is designed for inserting hyperlinks into jot-style documents. It inserts the specified string enclosed in a pair of backticks.

<P>Note:</P>

This section may not display properly, even if it does, sharp-eyed readers will have noticed backtick-like character used here is not a backtick (ASCII code 96) but unicode left-single-quote character (UTF-8 code E2, 80, 9C). This is because backticks are reserved for the introduction of hyperlinks in these documents.

SubsThenFindNx

> {Shift+F8}

Parameterless, repeats last substitution then find next. i.e. repeat previous substitution, then repeat last find.

FindNextAgain

> {Ctrl+F8}

In insert mode, the FindNext function will always prompt for the search string. FindNextAgain will just apply the last-used search-string parameter once again.

This function is provided for the benefit of insert-mode users - repeats the most recent search without re-prompting. It's entirely useless when in command mode - these users need only dab F8 again to repeat the search.

FindExact

> [<string>]{F9}

The buffer is searched until the next exact-match occurrence of the word is found - in this context an exact match is where the matching substring is bounded by non-alphanumeric characters.

FindExactBack

> [<string>]{Shift+F9}

Similar to above, except that it searches backwards.

SetFindString

> {Ctrl+F9}

The word below the cursor is picked up and defines the find string for the next find (or find exact) operation.

FindBack

> [<string>]{F7}

Find the previous occurrence of the specified string, if no string is specified then the string used in the last find is used.

SubsThenFindPv

> {Shift+F7}

Parameterless substitute then find previous. i.e repeat previous substitution then find previous occurrence of last-found string.

FindBackAgain

> {Alt+F7}

In insert mode, the FindBack function will always prompt for the search string. FindBackAgain will just apply the last-used search-string parameter once again.

This function is provided for the benefit of insert-mode users - repeats the most recent search without re-prompting. It's entirely useless when in command mode - these users need only dab F7 again to repeat their search.

NextHighlight

> {Esc m h}

Searches forwards for the next highlight of any sort. If there are no more highlights the focus is set to the last highlight in the buffer.

PrevHighlight

> {Esc m h}

Searches back for the previous highlight of any sort. If there are no more highlights the focus is set to the first highlight in the buffer.

FindSetHighlight

> [<string>]{Esc f h}

This begins by removing all highlights associated with FindSetHighlight and FindAddHighlight. It then searches the entire buffer for instances of the specified string, adding a highlight to each instance. On completion the original focus point is restored.

Selected highlights may also be removed by the FindRemHighlight function.

FindAddHighlight

> [<string>]{Esc + f h}

Similar to FindSetHighlight except that it does not remove preexisting highlights. It then searches the entire buffer for instances of the specified string, adding a highlight to each instance. On completion the original focus point is restored.

FindRemHighlight

> [<string>]{Esc - f h}

Searches the buffer for instances of the specified string, removing any highlights added by FindSetHighlight and FindAddHighlight from matching instances. On completion the original focus point is restored.

Note that FindRemHighlight does not remove substrings from highlights - if only part of a preexisting highlight matches the search string then the highlight is left unchanged.

Delete and Restore

The functions to do with deletion of bits of text are all attached to the left/right keys.

Text is deleted by moving it to the delete-bin buffer ( % ). When deleting left it goes to the front of the buffer, when deleting right it is moved to the end of the delete-bin buffer. The distinction is important because, to preserve the original order, text is restored character-by-character in the reverse direction.

The restore functions all restore to the current character position - they will effectively reinstate the original text provided:

It is, of course, possible to use the select and restore functions to move text by first deleting, moving the cursor and then restoring.

DeleteChrLeft

> {Alt+LeftArrow}

The character immediately to the left of the cursor is moved to the delete bin. If the cursor is at the start of a line, the current line is joined with the previous one.

DeleteChrRight

> {Alt+RightArrow}

The character immediately below the cursor is moved to the delete bin. If the cursor is at the end of a line, the current line is joined with the next.

DeleteWordLeft

> {Shift+Alt+LeftArrow}

The word immediately to the left of the cursor is moved to the start of the delete bin. If the cursor is at the start of a line, the current line is joined with the previous one and it's last word is deleted.

DeleteWordRight

> {Shift+Alt+RightArrow}

The word immediately to the right of the cursor is moved to the end of the delete bin. If the cursor is at the end of a line, the current line is joined with the next and it's first word is deleted.

DeleteLineLeft

> {Ctrl+Alt+LeftArrow}

All of the line immediately to the left of the cursor is moved to the start delete bin. If the cursor is at the start of a line, the current line is joined with the previous one.

DeleteLineRight

> {Ctrl+Alt+RightArrow}

All of the line immediately to the right of the cursor is moved to the end of the delete bin. If the cursor is at the end of a line, the current line is joined with the next one.

RestoreChrLeft

> {Ctrl+Shift+Alt+LeftArrow}

The first character in the delete-bin buffer is moved to the current-character position of the current buffer.

RestoreWordLeft

> {Esc - l w}

The first word in the delete-bin buffer is moved to the current-character position of the current buffer.

RestoreLineLeft

> {Esc - l l}

The first line in the delete-bin buffer is moved to the current-character position of the current buffer.

RestoreChrRight

> {Ctrl+Shift+Alt+RightArrow}

The last character in the delete-bin buffer is moved to the current-character position of the current buffer and becomes the new current character.

RestoreWordRight

> {Esc r w}

The last word in the delete-bin buffer is moved to the current-character position of the current buffer.

RestoreLineRight

> {Esc r l}

The last line in the delete-bin buffer is moved to the current-character position of the current buffer.

Advanced Searching

An earlier section (Find, Substitute and Insert) described jot's basic search and replace functions. This section covers functions designed to locate combinations of strings in large files. These functions are designed to help when a simple search will yield hundreds of matches but we're looking for specific combinations of words.

FindSequence

> [<string>]{Esc f q}

The editor will search for the sequence of words ignoring any non-alphanumeric delimiters including line breaks. One or more words can be represented by the wildcard character ( * ). The argument list is parsed and held in buffer @.

If no argument is given then it matches to whatever happens to be in the @ buffer.

This is function is useful for locating sequences of words after they have been reformatted in some way, with wildcards it is also useful for locating expressions in programming code.

FindSequenceBack

> [<string>] {Esc - f q}

Similar to FindSequence except that it searches back towards the start of the file.

FindLineOrd

> [<substr1>[ <substr2>[ ... ]]{Esc f o}

This finds the next occurrence of a line containing that sequence of substrings in the order specified.

The list of substrings is delimited by blanks, sequences of two or more blanks are treated as a single blank. If a substring contains blanks these are escaped with a backslash character ( \ ) e.g:

> substring1 substring2 substring\ containing\ blanks lastSubstring{Esc f p}

FindLineOrdBack

> [<substr1>[ <substr2>[ ... ]]{Esc - f o}

This is similar to FindLineOrd except that it works back from the current line towards the start of the file image.

The Proximity-Find Group of Functions

See the proximity search functions

ProximityPhrase

> [<multiplier> ][[<substringSpecification>]{Esc f r}

This is one of the proximity functions - see the proximity search functions for details.

Working forwards, this locates the next phrase containing all of the substrings in the substrings list. On successful completion, it highlights the matching substrings in your specification. If unsuccessful, the cursor is left at the end of the file image and a message is issued.

A phrase is any number of words, extending over any number of lines bounded by normal punctuation marks or the start or end of the buffer. Normal punctuation marks are ( . , : ; ? ! ).

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximityPhraseBack

> [<multiplier> ][[<substringSpecification>]{Esc - f r}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityPhrase except that the text is searched back, from the current-character position, towards the begining of the buffer.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximitySentence

> [<multiplier> ][<substringSpecification>]{Esc f s}

This is one of the proximity functions - see the proximity search functions for details.

A sentence is any number of words, extending over any number of lines bounded by a full-stop, blank lines or the start or end of the buffer.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximitySentenceBack

> [<multiplier> ][<substringSpecification>]{Esc - f s}

This is one of the proximity functions - see the proximity search functions for details.

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximitySentence except that the text is searched back from the current-character position. The proximity aperture runs from the end of the sentence containing the initial match, back to the start of that sentence or, if a multiplier of more than 1 is specified, then the n-th. previous sentence.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximityPara

> [<multiplier> ][<substringSpecification>]{Esc f p}

This is one of the proximity functions - see the proximity search functions for details.

Locates the next paragraph containing all of the substrings in the substrings list. On successful completion, it highlights the last substring in your parameter list. If unsuccessful, the cursor is left at the end of the file image and a message is issued.

A paragraph is any number of words extending over any number of lines bounded by a blank line, a bullet point or some other discontinuity in indent level.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximityParaBack

> [<multiplier> ][<substringSpecification>]{Esc - f p}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityPara except that the text is searched back, from the current-character position, towards the begining of the buffer.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximitySection

> [<multiplier> ][<substringSpecification>]{Esc f t}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityPara except that the allowable range is an complete section. ProximitySection locates the next section containing all of the substrings in the substrings list. On successful completion, it highlights the last substring in your parameter list. If unsuccessful, the cursor is left at the end of the file image and a message is issued.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximitySectionBack

> [<multiplier> ][<substringSpecification>]{Esc - f t}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityParaBack except that the allowable range is an complete section.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximityBlock

> [<multiplier> ][<substringSpecification>]{Esc f b}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityPara except that the allowable range is an entire block. Blocks are any number of lines of text bounded by an completely blank line (i.e. containing not even blanks) or the buffer end.

ProximityBlock locates the next block containing all of the substrings in the substrings list. On successful completion, it highlights the last substring in your parameter list. If unsuccessful, the cursor is left at the end of the file image and a message is issued.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximityBlockBack

> [<multiplier> ][<substringSpecification>]{Esc - f b}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityBlock except that the text is searched back, from the current-character position, towards the begining of the buffer.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ProximityChapter

> [<multiplier> ][<substringSpecification>]{Esc f c}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityPara except that the search range is all of the text between pairs of chapter marks (See about words, lines, phrases, sentences, paragraphs, sections and chapters).

ProximityChapterBack

> [<multiplier> ][<substringSpecification>]{Esc - f c}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityParaBack except that the search range is all of the text between pairs of chapter marks (See about words, lines, phrases, sentences, paragraphs, sections and chapters).

ProximityPage

> [<multiplier> ][<substringSpecification>]{Esc f g}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityPara except that the search range is all of the text between pairs of page marks (See about words, lines, phrases, sentences, paragraphs, sections and chapters).

ProximityPageBack

> [<multiplier> ][<substringSpecification>]{Esc - f g}

This is one of the proximity functions - see the proximity search functions for details.

Similar to ProximityParaBack except that the search range is all of the text between pairs of page marks (See about words, lines, phrases, sentences, paragraphs, sections and chapters).

ProximityLines

> [<multiplier>] [<substr1>[ <substr2>[ ... ]]{Esc f l}

This is one of the proximity functions - see the proximity search functions for details. The multiplier specifies how many full lines to be included in the search aperture - it defaults to 1.

If the expression is not specified then the most recently used proximity expression is used again. If only the multiplier is specified then the previous specification is repeated but with the new aperture size.

ProximityLinesBack

> [<multiplier> [<substr1>[ <substr2>[ ... ]]{Esc - f l}

Similar to ProximityLines except that it searches back from the current cursor position, towards the start of the file image.

ProximityWords

> [<multiplier>] [<substr1>[ <substr2>[ ... ]]{Esc f w}

This is one of the proximity functions - see the proximity search functions for details. The multiplier specifies how many words to be included in the search aperture - it defaults to 10. For the purposes of ProximityWords a word is taken to be a string of any number of alphanumeric characters bounded by any number of non-alpha characters or line breaks.

If the expression is not specified then the most recently used proximity expression is used again. If only the multiplier is specified then the previous specification is repeated but with the new aperture size.

ProximityWordsBack

> [<multiplier> [<substr1>[ <substr2>[ ... ]]{Esc - f w}

Similar to ProximityWords except that it searches back from the current cursor position, towards the start of the file image.

ProximityCharacters

> [<multiplier>] [<substr1>[ <substr2>[ ... ]]{Esc f n}

This is one of the proximity functions - see the proximity search functions for details. The multiplier specifies how many characters to be included in the search aperture - it defaults to 100.

If the expression is not specified then the most recently used proximity expression is used again. If only the multiplier is specified then the previous specification is repeated but with the new aperture size.

ProximityCharactersBack

> [<multiplier> [<substr1>[ <substr2>[ ... ]]{Esc - f n}

Similar to ProximityCharacters except that it searches back from the current cursor position, towards the start of the file image.

The vertical-search functions

All of the find functions encountered so far match to strings written horizontally across one or more lines, the vertical find functions accept a normal horizontally-written search-string parameter specification but match to a series of characters written vertically down in a column. The first character in the specification matches to the character topmost character in the matching column, the second to the the character immediately below, etc.

All these functions support a limited selection of special characters:

For examples of the syntax look at Locating text in columns and blocks in the examples.

findCol
> [<string>]{Esc f y}

Searches forwards (down) in the current column (Y-direction) for the specified string written downwards in the current column. If the search string is not specified then it searches for the last string given for any vertical search.

findColBack
> [<string>]{Esc - f y}

Searches back (up) in the current column (Y-direction) for the specified string written downwards in the current column. If the search string is not specified then it searches for the last string given for any vertical search.

findVert
> [<string>]{Esc f v}

Searches forwards (down) in all columns for the specified string written downwards in any column. If the search string is not specified then it searches for the last string given for any vertical search.

findVertBack
> [<string>]{Esc - f v}

Searches back (up) in all columns for the specified string written downwards in any column. If the search string is not specified then it searches for the last string given for any vertical search.

findRect
> [<key>]{Esc f e}

The function searches for a rectangular block of text matching a specification.

The key defines a buffer containing the search specification, this defines a rectangular array of characters to be located (see below for details). The specification is copied into a data object which will be used for subsequent findVert{Back} searches with no key specified. If no buffer key is specified then it reverts to the previously-defined specification.

Each line of the specification defines a column to be identified in the search buffer. As usual, case sensitivity is set by the %s=case command.

findRectBack
> [<key>]{Esc - f e}

This is similar to findRect except that it searches backwards (up the screen towards the begining of the buffer.

Text Document Preparation

The startup script offers a suite of basic text-document preparation functions.

[<string>]{KP_Enter}
Enter - enters a new line of text below the cursor. [<string>]{Esc e} Enter - as above for those without a {KP_Enter} key.

[Word] {Esc s w} SpellcheckWord Checks Spelling of a single word offered as a parameter.

[<RE>] {Esc s x} SpellLexicon grep for regular expression in Lexicon.

Enter

> [<string>]{KP_Enter}

or

> [<string>]{Esc e}

The string is inserted as a new line with indent level inherited from previous line. If no string is given then creates a blank line at the same indent level as the line above. This function only useful in command mode.

ReformatParagraph

> {Esc p a}

Re-formats the current paragraph, the paragraph is deemed to be the current line and all the adjacent lines with the same indent level. This adjusts whitespace between words to align line endings, the line-length to aim for is set by the SetParagraphMargin function.

If the paragraph with a bullet mark (typically a dash followed by at least one blank) then the length of the bullet mark is included in the indentation calculation.

The jot word processor takes a paragraph as any number of nonblank lines of text at the same level of indentation but note that the paragraph definition used by the startup-defined functions is less strict - for these functions a paragraph is any number of lines bounded by blank lines. These functions are ChapterUp, ChapterDown, ProximityPara, ProximityParaBack, ProximityChapter and ProximityChapterBack - See about words, lines, phrases, sentences, paragraphs, sections and chapters.

A line of text can be protected from the paragraph processor ({Esc p a} and {Esc P a}) by placing a non-blank character in column 1 - in this context a tab is taken as a non-blank character.

ReFormatAll

> {Esc P a}

Reformats all paragraphs (as described in ReformatParagraph) in the current buffer.

NewParagraph

> <text>{Esc p n}

Inserts the text as a new paragraph immediately below the current line.

SetParagraphMargin

> [n]{Esc p m}

Sets the right margin to the specified column, if not specified then it defaults to two character positions less than the current terminal width. This is used for reformatting paragraphs - see ReformatParagraph.

RightJustifyLine

> {Esc r j}

Indents current line with sufficient blanks to shift the righthand extremity of the current line to the right margin (defaults to 78 characters, set by the SetParagraphMargin function.

MakeParagraphIntoBullet

> {Esc b u}

Reformats current paragraph as a bullet-point paragraph.

HeadingCentred

> {Esc h c}

The text in the current line is indented with sufficient blanks to position it approximately in the centre of the line using the current left and right margin settings (see SetParagraphMargin). The text is then underlined with hyphens.

UnderlineThisLine

> {Esc u l}

As it's name suggests, this one underlines all characters in the current line as far as the last non-blank character.

ConvertLineToHeading

> [ProformaHeadingKey]{Esc h e}

Makes the current line into a section heading. e.g:

> 0{Esc h e} - makes current line next top-level heading

In fact, the section number given here is ignored - only the header level is significant, the header index numbers are inherited from the previous heading. So this will have exactly the same effect:

> 999{Esc h e}

But

> 12.34.56.78{Esc h e} - makes current line next level-4 heading

Again, the section numbers given here are ignored - so this will have exactly the same effect:

> ...{Esc h e} - makes current line level-4 heading

Section headings are in two sections separated by whitespace. The first part is a key of the form <n1>[.<n2>[.<n3>...]] e.g. 9.3.99, the second part is any text string e.g:

The heading level is determined by the previous heading but the final counter is incremented. If the current line has any kind of header level, this is taken as a proforma and the new header level will have the same number of levels but will inherit the numbering from the previous heading.

If a proformaHeadingKey is given this defines the proforma and any preexisting heading key is ignored.

By default, headings above level 4 (i.e. 1.2.3.4...) are underlined, this behaviour is controlled by the DocHeaderMax variable.

UpHeadingLevel

> {Esc h +}

Makes the current line into a section heading, the heading level is one higher than the previous heading.

DownHeadingLevel

> {Esc h -}

Makes the current line into a section heading, the heading level is one lower than the previous heading.

PurgeAllHeadings

> {Esc h a}

Resets all headings, the heading levels are unchanged, but out-of-sequence section numbers are redefined - use this after inserting or removing sections.

SpellcheckDocument

> {Esc s d}

Checks the entire document for spelling errors using aspell (a GNU spelling checker), if the there is a spell.lis file in the same directory as the document, then this is passed to the aspell checker. The list of misspelled words is read and instances of the misspelled words can be indexed using the NextMisspelling and NextSpellInstance.

Some versions of aspell offer a selection of suggested corrections, if jot detects these then it displays them in a popup menu - see the popup-menu functions of mice and menus and about menus.

Linux users may find an aspell with their distribution. There are several similar spelling checkers but aspell can be used in command mode with an error report sent to stdout. Most others insist on you using their gui. If your distro does not have it or you are a windows user then try http://aspell.net

The original ASpell report is held in the ( # ) buffer, should you want to see this. See also SpellcheckSection, SpellcheckParagraph and SpellcheckWord.

SpellcheckSection

> {Esc s s}

Similar to SpellcheckDocument except that it checks only the current section for spelling errors - see about words, lines, phrases, sentences, paragraphs, sections and chapters.

SpellcheckParagraph

> {Esc s p}

Similar to SpellcheckDocument except that it checks only the current paragraph for spelling errors - see about words, lines, phrases, sentences, paragraphs, sections and chapters.

SpellcheckWord

[<word>]{Esc s w}

Similar to SpellcheckDocument except that it checks only the current word or the given word. Passes the word through the spelling checker the checkers suggested corrections are displayed in the popup menu.

SpellcheckWord also has the helpful feature of preserving the original spelling-checker database so, if you're part-way through the aspell results for a big document, you can quickly check a correction without having to re-check the entire document.

NextMisspelling

> {Esc s n}

Moves to the next misspelled word in a list generated by by SpellcheckDocument or one of the similar spelling-checker functions and locates the next instance of that word. If aspell offers a list of possible corrections, this is displayed as a popup menu.

To replace the current instance of a misspelled word, click on the desired correction and that word will appear in the console area, then press {F5} (Substitute) to fix the spelling.

The processed list of results from aspell are held in the '#' buffer.

NextSpellInstance

> {Esc s i}

Moves to the next instance of the current misspelled word found by SpellcheckDocument or one of the similar functions. If there are no more instances of that word it then calls NextMisspelling to move to the next misspelled word in the aspell report.

The processed list of results from aspell are held in the '#' buffer.

SpellLexicon

> <RE>{Esc s x}

This launches grep, which has been set up to find matching words in the lexicon.

This is sometimes useful for looking up spellings, the lexicon is quite small so there are plenty of valid words that don't match but, on the plus side, it unlikely to match archaic or obscure words that hardly anyone knows.

Doc section and paragraph format

Typically, most lines of of text in documents are in paragraphs. For the purposes of the jot document system, paragraph lines are always indented by at least one blank. In order to distinguish paragraph lines from special text such as headings, tables and literal text such as code examples these must have a non-blank character in column 1 (tabs count as non-blanks for this purpose).

Text documents are deemed to consist of sections, introduced by a section heading and containing any number of paragraphs.

Several scripts are designed to text documents in document format, these make the following assumptions about the structuring of the text - see text document preparation.

Fred

This is name frequently used by unimaginative technical authors.

AppendLeftPrev

> {Alt+F9}

Appends text to the left of the current character to the end of the previous line, preserving indentation of both lines.

AppendRightNext

> {Alt+F10}

Appends text under and to the right of the current character, to the start of the next line, preserving the indentation of both lines.

JoinLeftPrev

> {Shift+Alt+F9}

Joins current line to end of previous line, excluding indentation whitespace. It also adds a gratuitous blank if it deems this necessary.

JoinRightNext

> {Shift+Alt+F10}

Joins current line to the start of the next line, excluding indentation whitespace. It also adds a gratuitous blank if it deems this necessary.

IndentFromPrev

> {Ctrl+Shift+F9}

Removes all indentation blanks from the current line and replaces them with those from the previous line.

IndentFromNext

> {Ctrl+Shift+F10}

Removes all indentation blanks from the current line and replaces them with those from the next line.

Break

> {Esc b r}

This breaks the current line at the current character position. Text to the right of the break ends up on the next line, this inherits indentation from the original line.

Context-Dependant Navigation Functions

These move the current focus point the the start or end of structural unit (e.g a paragraph, headed section or chapter) in the text - see About words, lines, phrases, sentences, paragraphs, sections and chapters

In general their escape sequences begin {Esc m ... for forward movement and {Esc - m ... for backwards movement.

ParagraphUp

> {Esc - m p}

Searches for the previous paragraph start. A paragraph is any number of lines delimited by either a blank line, a discontinuity in the line indentation level or by the top or bottom of the buffer.

ParagraphDown

> {Esc m p}

Searches down the text for the next paragraph start. A paragraph is any number of lines delimited by either a blank line, a discontinuity in the line indentation level or by the top or bottom of the buffer.

ChapterUp

> {Esc - m c}

Searches back up the text for the previous chapter heading.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

ChapterDown

> {Esc m c}

Searches the text for the next chapter heading.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

PageUp

> {Esc - m g}

Searches back up the text for the previous page heading.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

PageDown

> {Esc m g}

Searches the text for the next page heading.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

SectionUp

> {Shift+F3} > {Esc - m n}

Searches back up the text for the previous section heading.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

SectionDown

> {Shift+F4} > {Esc m n}

Searches forwards for the next section heading.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

BlockUp

> {Esc - m b}

In this context, a block of text is any number of lines bounded by an completely blank line or one of the ends of the buffer. This function searches back up the text for the previous blank line and leaves the cursor at the start of the next non-blank line.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

BlockDown

> {Esc m b}

In this context, a block of text is any number of lines bounded by an completely blank line or by one of the ends of the buffer. This function searches for the next blank line and leaves the cursor at the start of the next non-blank line.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

PhraseUp

> {Esc - m r}

Searches backwards in the text for the start of the current phrase - a phrase is any number of words, over any number of lines, bounded by either any punctuation mark or a paragraph boundary.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

PhraseDown

> {Esc m r}

Searches forwards in the text for the end of the current phrase - a phrase is any number of words, over any number of lines, bounded by either any punctuation mark or a paragraph boundary.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

SentenceUp

> {Esc - m s}

Searches backwards in the text for the start of a sentence - sentences are deemed to begin with an upper-case alpha character which must follow either ASCII full stop ( . ) or a blank line separated by any at least one whitespace character.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

SentenceDown

> {Esc m s}

Searches forwards in the text for the next sentence - sentences are deemed to begin with an upper-case alpha character which must follow either ASCII full stop ( . ) or a blank line separated by at least one whitespace character.

See about words, lines, phrases, sentences, paragraphs, sections and chapters.

Context-Independent Navigation

These functions move focus without reference to the text. They move the editor focus up and down in the text file image.

Up

> [<n>]{UpArrow}

Move up by n lines (defaults to 1) - the current line becomes the line n lines above original current line, the current character is the first character of the new line.

WordUp

> {Shift+UpArrow}

The behaviour for tabular and non-tabular documents is different - see about tabular text for details. Essentially, for non-tabular text, WordUp moves the cursor up in a column, for tabular text WordUp moves p in the current table column.

For non-tabular text the the column is defined by the NewWordUp and NewWordDown functions using the Y0 flavour of the Y command. This locks the WordUp/Down functions into to a particular column.

For tabular text, WordUp/Down ignores the Y-command column and simply navigates up or down from the current cell in the table.

NewWordUp

> {Ctrl+UpArrow}

Sets the column for the WordUp function, subsequent invocations of WordUp will attempt to stay in the same column as the current character - see the Y command.

Down

> [<n>]{DownArrow}

Move down by n (defaults to 1) lines - the current line pointer is shifted down, the current character becomes the first character of the new line.

WordDown

> {Shift+DownArrow}

Similar to WordUp except that it moves the cursor down the screen.

NewWordDown

> {Ctrl+DownArrow}

Sets the column for the WordDown function, subsequent invocations of WordDown will attempt to stay in the same column as the current character - see the Y command.

ColumnStretch

> {Esc c +}

When viewing tabular text (e.g. a spreadsheet) this enlarges the width of the current column by one character. Note that this function also has the effect of freezing the column widths. See about tabular text.

ColumnShrink

> {Esc c -}

When viewing tabular text (e.g. a spreadsheet) this reduces the width of the current column by one character. Note that this function also has the effect of freezing the column widths. See about tabular text.

Home

Not currently assigned to any key.

The current line is set to the first line in the file, the current character is the first character of the line.

End

Not currently assigned to any key.

The view is change to the last page in the file, the current line is the last line of the buffer, the current character becomes the first character of this line.

Left

> [<n>]{LeftArrow}

or

> [<n>]{Ctrl+KP_4}

Move the cursor n (defaults to 1) characters left of it's original position.

The same function is attached to {Ctrl+KP_4} and {Esc m w} for consistency and for the benefit of those navigating a line drawing. It's easier to hold the Ctrl key down while using the other line-drawing navigation functions on {Ctrl+KP_2}, {Ctrl+KP_8} and {Ctrl+KP_6}

WordLeft

> [<n>]{Shift+LeftArrow}

or

> [<n>]{Esc - m w}

For tabular text, i.e. the current line contains Tab characters, this moves the cursor to the cell left of the current cell and, if necessary, adjusts leftoffset (see About long lines) to bring all of the cell into view.

For non-tabular text, this moves the cursor to the start of previous word. If the cursor is not currently above a word the cursor moves to the start of the current word.

If n is given the process is repeated that many times.

Modern versions of windows have a short-cut defined for {Shift+LeftArrow} and there does not seem to be any way of disabling it. The alternative escape sequence {Esc - m w} has been provided for users affected by this.

LineLeft

> {Ctrl+LeftArrow})

Moves to the start of the current line, if already at the start of line moves to the start of the previous line.

Right

> [<n>]{RightArrow}

Move the cursor n (defaults to 1) characters right of it's original position.

WordRight

> [<n>]{Shift+RightArrow}

or

> [<n>]{Esc m w}

For tabular text, i.e. the current line contains Tab characters, this moves the cursor to the cell right of the current cell and, if necessary, adjusts leftoffset (see About long lines) to bring all of the cell into view.

For non-tabular text, this moves the cursor to the start of next word. If the cursor is not currently above a word the cursor moves to the start of the current word.

If n is given the process is repeated that many times.

Modern versions of windows have a short-cut defined for {Shift+LeftArrow} and there does not seem to be any way of disabling it. The alternative escape sequence {Esc m w} has been provided for users affected by this.

LineRight

> [<n>]{Ctrl+RightArrow}

Moves to the end of the current line, if already at the end of a line it move to the end of the next line.

ScreenNext

> [<n>]{PageUp}

The view changed to show the page above the previously-displayed page of text, the current-line is changed according to the current window size and the character pointer is set to the first character of the new line.

ScreenPrev

> [<n>]{PageDown}

The view is changed to the page below the current page.

GotoFoldStart

Not currently assigned to any key.

Find matching fold-start. In a file with fold marks, when at a fold end, this will search back for the corresponding fold start.

GotoFoldEnd

Not currently assigned to any key.

Find matching fold end. In a file with { { { and } } } fold marks, when at a fold start, this will search for the corresponding fold end.

Copy Paste and Related Functions

The mapping of functions to the mid keypad approximates to most of the key-cap functions but not, perhaps, the meaning IBM originally intended.

Users lacking the mid keypad need not despair, for the benefit of them and their tiny laptops, the cut and paste operations are also available on function keys. Users lacking a mid keypad need not despair, most of these functions are also available as escape sequences.

Note

> {Ctrl+Shift+F1}

or

> {Home}

or

> {Esc n o}

The current character position is noted for a later cut or copy operation.

Cut

> {Ctrl+Alt+F2}

or

> {Delete}

or

> {Esc c u}

Text from the last-defined note point up to the current character position is moved the paste buffer - this the the _ buffer in jot.

Copy

> {Ctrl+Shift+F3}

or

> {End}

or

> {Esc c o}

Text from the last-defined note point up to the current character position is copied to the paste buffer. This operation is permitted for Readonly buffers - see %b=readonly where the Cut operation is guaranteed to fail.

Paste

> {Ctrl+Shift+F4}

or

> {Insert}

or

> {Esc p t}

The contents of the paste buffer is inserted into the text at the current character position.

CumulativeCopy

> {Shift+Alt+F3}

or

> {Shift+End}

Text from the last-defined note point up to the current character position is appended to the end of the paste buffer. This operation is permitted for Readonly buffers (see %b=readonly). If no note point was set, then the complete line is copied to the paste buffer.

CutTabular

> {Ctrl+Shift+Alt+F2}

or

> {Ctrl+Delete}

CutTabular removes the selected text to the paste buffer but the text is replaced by blanks. The intention is to preserve the structure of a whitespace-separated table.

CumulativeCut

> {Shift+Alt+F2}

or

> {Shift+Delete}

The CumulativeCut function removes the selected text, appending it to the end of the paste buffer.

CutRectangle

> {Ctrl+Shift+Alt+F3}

or

> {Alt+Delete}

or

> {Esc r c}

First go to the top left corner of the rectangle and note the position with Note, then move the cursor to the bottom-right corner of the rectangle and apply CutRectangle. The text is removed and replaced by blanks leaving the current character at the original note point (the top-left corner of the cut text).

To restore the text at it's original position apply PasteRectangle immediately after CutRectangle.

PasteRectangle

> {Ctrl+Shift+Alt+F4}

or

> {Alt+Insert}

or

> {Esc r p}

The paste buffer is assumed to contain some graphical or tabular text (i.e. some lines of text where both the horizontal and vertical placement of characters is significant). The picture is inserted at the current character position and in the same column of succeeding lines, text to the right of the inserted block retains it's original position. The CutRectangle function can be used to extract the block of text.

rotateDiagonal

> {Esc r d}

This rotates all characters around the leading diagonal - this function may be of use for some types of block diagrams.

rotateHorizontal

> {Esc r h}

This rotates whole lines of text around the central horizontal axis so that the order of the lines is reversed - this function may be of use for some types of block diagrams.

rotateVertical

> {Esc r v}

This rotates all the text columns around the central vertical axis so that the order of the columns is reversed, adding extra whitespace when necessary

Matching Functions

Most of these are about finding matching brackets of various kinds. e.g. Finding the closing ')' matching the '(' under the cursor, there's also ones for matching indentation levels.

MatchIndentUp

> {Ctrl+Shift+F7}

or

> {Esc - m i}

Searches back up the text for the previous line at the same indent level as the current line. Initially the cursor may be anywhere in the line, on completion it is left on the first non-blank character of the line.

MatchIndentDown

> {Ctrl+Shift+F8}

or

> {Esc m i}

Searches forwards in the text for the next line at the same indentation level as the current line. Initially the cursor may be anywhere in the line, on completion it is left on the first non-blank character of the line.

MatchAny

> {Esc m a}

This function matches some form of brace character with it's mate, the cursor must be positioned over a brace character.

The cursor must initially be placed over one of the following characters: (, {, [, <, ), }, ] or >. The MatchAny function then calls the appropriate matching function (respectively MatchParenLeft, MatchCurlyLeft, MatchSquareLeft, MatchAngleLeft, MatchParenRight, MatchCurlyRight, MatchSquareRight or MatchAngleRight) to locate the matching character in the text. On completion the cursor is placed over the matching brace character.

MatchParenLeft

> {Shift+Alt+F5} > {Esc m ) }

This function matches parenthesis characters in natural and some machine languages. The difficulty with machine languages is they have different syntax's for the specification of strings and comments - if unbalanced parenthesis appear in a string or a comment then this causes simplistic counting algorithms to fail.

The jot functions MatchParenLeft and MatchParenRight have been set up to recognize C and jot code and it takes appropriate action to avoid miscounting. to successfully navigate it's way past any comments and string expressions. The function begins by identifying the language. It checks the first few lines of the buffer for a valid C or jot comment beginning at the start of the line. If none is found then it assumes the buffer to contain natural-language text.

If the cursor is above a parenthesis close character ')', then the cursor is moved back (leftwards and upwards) to the corresponding parenthesis open. This works by plodding through the text, counting open and close braces ( and ), until the corresponding parenthesis-open character is found.

Between the initial ')' and it's matching '(', parenthesis characters in strings delimited by double quotes ( " ) are ignored as are matching pairs of parenthesis characters which may be nested to any depth.

If the cursor is not above a parenthesis-close character, then the buffer is searched back to find the previous parenthesis close and the cursor moved to the corresponding parenthesis open.

MatchParenRight

> {Shift+Alt+F6} > {Esc m ( }

This function matches parenthesis characters in natural and some machine languages. The difficulty with machine languages is they have different syntax's for the specification of strings and comments - if unbalanced parenthesis appear in a string or a comment then this causes simplistic counting algorithms to fail.

The jot functions MatchParenLeft and MatchParenRight have been set up to recognize C and jot code and it takes appropriate action to avoid miscounting. to successfully navigate it's way past any comments and string expressions. The function begins by identifying the language. It checks the first few lines of the buffer for a valid C or jot comment beginning at the start of the line. If none is found then it assumes the buffer to contain natural-language text.

If cursor is above a parenthesis open '(' character, then cursor is moved forwards (rightwards and downwards) to the corresponding parenthesis close ')'. This works by plodding through the text, counting open and close braces ( and ), until the corresponding parenthesis-close character is found.

Between the initial '(' and it's matching ')', parenthesis characters in strings delimited by double quotes ( " ) are ignored as are matching pairs of parenthesis characters which may be nested to any depth.

If the current character is not above a parenthesis-open character, then it searches forwards for one and then finds the corresponding parenthesis close character.

MatchCurlyLeft

> {Ctrl+Shift+Alt+F5} > {Esc m } }

Similar to <<MatchParenLeft>>, above, except matches { and }.

Note, if intending to traverse C code, c.jot is preferable as this script will ignore any curly brackets in C comments and strings.

MatchCurlyRight

> {Ctrl+Shift+Alt+F6} > {Esc m { }

Similar to <<MatchParenRight>>, above, except matches { and }.

Note, if intending to traverse C code, c.jot is preferable as this script will ignore any curly brackets in C comments and strings.

MatchAngleLeft

> {Ctrl+Shift+F5} > {Esc m < }

Similar to <<MatchParenLeft>>, above, except matches < and >.

MatchAngleRight

> {Ctrl+Shift+F6} > {Esc m > }

Similar to <<MatchParenRight>>, above, except matches < and >.

MatchSquareLeft

> {Ctrl+Shift+Alt+F7} > {Esc m [ }

Similar to <<MatchParenLeft>>, above, except matches [ and ].

MatchSquareRight

> {Ctrl+Shift+Alt+F8} > {Esc m ] }

Similar to <<MatchParenRight>>, above, except matches [ and ].

MatchMarkupLeft

> {Esc - m m }

This is for use with HTML and XML. MatchMarkupLeft, works back from the current cursor position, it first locates the previous "</" string - indicating the end of a block in HTML and XML. It then picks up the block-type tag and finds the corresponding block-start.

MatchMarkupRight

> {Esc m m }

This is for use with HTML and XML. MatchMarkupRight works forwards from the current cursor position, it first locates the next "<" character - indicating a block start in HTML and XML. It then picks up the block-type tag and finds the corresponding block-end.

Line-drawing Functions

The following line-drawing functions are provided. Many are driven by the numeric keypad, unix users will have to set these up - see X-windows setup.

The following unicode character set is used for line drawing:

For drawing with ASCII characters (the default - see LineDefaultChrs), only the Hyphen ( - ) and Vertical bar ( | ) are used.

In addition, there is limited support for diagonal drawing (see LineSW, DSLineSW, LineSE, DSLineSE, LineNW, DSLineNW, LineNE, DSLineNE, Lozenge and DSLozenge but these use the simple ascii Oblique ( \ ) and ( / ) characters and there is no automatic intersection.

The drawing functions proceed in the appropriate direction inserting the appropriate line-drawing character. This is typically a simple line element but, when there is a change in direction or when the new line collides with an existing line, an appropriate corner or intersection character is used.

If the North and South functions push into a shorter line, additional whitespace is added. If they collide with the start or end of the buffer an extra line and whitespace is added.

All of the line-drawing functions will accept an argument of any number of characters, this argument is inserted, character by character, instead of the normal line-drawing characters. When used with the LineW or LineN functions the character order is reversed - it is assumed your arg is a word and it's easier to read words Left-to-Right or Top-to-Bottom.

For users with a numeric-keypad the line-drawing functions are mapped to {Ctrl+Alt+<key>} - thus we can draw thins by simply holding down {Ctrl} and {Alt} and dabbling away with the bean-counter keys. For those without that keypad it will be necessary to type in the escape sequence and then hit the repeat button {F10} to grow the line in the desired direction.

See about line drawing and graphical text - 1 ...

LineDefaultChrs

> <key>{Esc l d}

Where the key is one of the following:

The unicode characters include appropriate unicode characters for line intersections, corners and tees. For ASCII, the intersections are either whitespace or stops ( . ).

Intersection characters are inserted when the currently-drawn line collides with some previously drawn line.

See about line drawing and graphical text - 1 ...

UpRegardless

> {Ctrl+KP_8}

This is intended for line-drawings. When editing these it is essential that, as the cursor moves up or down, it remains in the same column. This is achieve by adding extra whitespace to the end of lines too short to maintain the cursor position.

Also, if the original line was the first line in the buffer, a new blank line is inserted and populated with whitespace.

See about line drawing and graphical text - 1 ...

DownRegardless

> {Ctrl+KP_2}

This is intended for navigating around line-drawings. When editing these it is essential that, as the cursor moves up or down, it remains in the same column. This is achieve by adding extra whitespace to the end of lines too short to maintain the cursor position.

Also, if the original line was the last line in the buffer, a new blank line is inserted and populated with whitespace.

See about line drawing and graphical text - 1 ...

RightRegardless

> [<n>]{Ctrl+KP_6}

Moves the cursor one character to the right, if the cursor is already at the end of a line then inserts one blank. This behaviour is designed to facilitate navigation around line drawings - see also <<UpRegardless>> and <<DownRegardless>>.

See about line drawing and graphical text - 1 ...

LineNW

> [<string>]{Ctrl+Alt+KP_7}

or

> [<string>]{Esc \ u}

A line-drawing function. Draws string, from the current-character position in a north-westerly direction. If <string> is unspecified, draws a single backslash ( \ ).

As with other drawing functions, <<LineNW>> always creates new lines and inserts padding whitespace where necessary but will fail when the cursor is in column 1 (the first character of a line).

See about line drawing and graphical text - 1 ...

LineN

> [<string>]{Ctrl+Alt+KP_8}

or

> [<string>]{Esc l n}

A line-drawing function. Draws string, from the current-character position in a northerly direction. If <string> is unspecified, draws a single vertical bar ( | ).

See about line drawing and graphical text - 1 ...

LineNE

> [<string>]{Ctrl+Alt+KP_9}

or

> [<string>]{Esc / u}

A line-drawing function. Draws string, from the current-character position in a north-easterly direction. If <string> is unspecified, draws a single slash ( / ).

See about line drawing and graphical text - 1 ...

LineE

> [<string>]{Ctrl+Alt+KP_4}

or

> [<string>]{Esc l e}

A line-drawing function. Draws string, from the current-character position in a easterly direction. If <string> is unspecified, draws a single hyphen (

LineW

> [<string>]{Ctrl+Alt+KP_6}

or

> [<string>]{Esc l w}

A line-drawing function. Draws string, from the current-character position in a westerly direction. If <string> is unspecified, draws a single hyphen (

LineSW

> [<string>]{Ctrl+Alt+KP_1}

or

> [<string>]{Esc / d}

A line-drawing function. Draws string, from the current-character position in a south-easterly direction. If <string> is unspecified, draws a single slash ( / ).

As with other drawing functions, <<LineSW>> always creates new lines and inserts padding whitespace where necessary but will fail when the cursor is in column 1 (the first character of a line).

See about line drawing and graphical text - 1 ...

LineS

> [<string>]{Ctrl+Alt+KP_2}

or

> [<string>]{Esc l s}

A line-drawing function. Draws string, from the current-character position in a southerly direction. If <string> is unspecified, draws a single backslash ( \ ).

See about line drawing and graphical text - 1 ...

LineSE

> [<string>]{Ctrl+Alt+KP_3}

or

> [<string>]{Esc \ d}

A line-drawing function. Draws string, from the current-character position in a south-easterly direction. If <string> is unspecified, draws a single backslash ( \ ).

See about line drawing and graphical text - 1 ...

DSLineNW

> [<string>]{Esc \ n}

A line-drawing function similar to LineNE except that it inserts extra whitespace to draw at something like 45deg - the actual angle depends on your font size.

See about line drawing and graphical text - 1 ...

DSLineSE

> [<string>]{Esc \ s}

A line-drawing function similar to LineSE except that it inserts extra whitespace to draw at something like 45deg - the actual angle depends on your font size.

See about line drawing and graphical text - 1 ...

DSLineSW

> [<string>]{Esc / s}

A line-drawing function similar to LineSE except that it inserts extra whitespace to draw at something like 45deg - the actual angle depends on your font size.

See about line drawing and graphical text - 1 ...

DSLineNE

> [<string>]{Esc / n}

A line-drawing function similar to LineNE except that it inserts extra whitespace to draw at something like 45deg - the actual angle depends on your font size.

See about line drawing and graphical text - 1 ...

Box

> [<width> <height>]{Esc b x}

This draws a box, using hyphens ( - ) and vertical bars ( | ), with the top-left corner of the box at the current cursor position. If the dimensions are not specified, the box size defaults to 10 characters wide by 5 lines high.

See about line drawing and graphical text - 1 ...

Lozenge

> [<size>]{Esc z 1}

This draws a lozenge shape using slashes ( / ) and backslashes ( \ ). The size is the number of slashes down any side, and defaults to 5.

See about line drawing and graphical text - 1 ...

DSLozenge

> [<size>]{Esc z2}

Similar to the Lozenge function except that it uses double-spacing.

See about line drawing and graphical text - 1 ...

BoxText

> <string>{Esc b t}

This inserts text into an area bounded my line drawn with Hyphens ( - ), Vertical bars ( | ), or slashes ( / and \ ). It is intended to simplify the process of labelling boxes where the label requires more than one line in the box.

See about line drawing and graphical text - 1 ...

Window management

These functions define and modify the configuration of viewing windows of the editor.

WindowOne

> [n]{Esc w 1}

Restores display to a simple window showing current buffer, clears colour tags from current buffer and resets the left offset for the current buffer.

The "One" in the function name refers to the size of the console area, which defaults to one line. The optional numeric argument is used to define the desired console-area size. The new window height is calculated so as to leave the specified number of lines for the console area.

The size of the window can be adjusted using the WindowShrink function, to increase the size of the console area at the expense of the window or WindowStretch function, to increase the size of the window at the expense of the console.

See also WindowHorizSplit and WindowVertSplit functions.

WindowHorizSplit

> {Esc w h}

Splits the screen horizontally giving one more window than is currently on display.

This function counts the total number of windows <n> currently displayed on screen, irrespective of whether they are vertical or horizontal splits, and redefines the windows as <n+1> horizontal strips, leaving a 1-line console area. The size of a window can be adjusted using WindowShrink and WindowStretch - note the optional window-selection argument to these functions.

The new-window focus is initially set to the current buffer - this may be displayed by some other window. Any focus-change operation (Z, %I, %Q etc. ) will affect the bottom window on the display.

See also WindowOne and WindowVertSplit functions.

WindowVertSplit

> {Esc w v}

Vertical split of the display terminal into one more window slices than is currently on display.

If the last window on the display is a slice, then it shrinks that ant other members of it's group to accommodate another slice and a new slice is added to the group. If the last window on the screen is full width then it is replaced by a pair of slices.

The last (rightmost) slice is not assigned to a buffer but the other members of the group are assigned to the buffers they were displaying at the time WindowVertSplit was called.

See also WindowOne and WindowHorizSplit functions.

Adjusting the view in a window

This group of functions are about adjusting the text placement within a window.

ViewAlignTop

> [winNo]{Esc v t}

Essentially, this adjusts view to bring the current line to the top of the viewing window. If you have a guardband set (see %s=guardband) then the current line will not approach the top margin by fewer than the specified number of lines.

When there is only one window then that's all there is to it. When there are more windows, it's a bit more complicated.

ViewAlignCent

> [winNo]{Esc v c}

Essentially, this adjusts view to bring the current line to the centre of the viewing window.

When there is only one window then that's all there is to it. When there are more windows, it's a bit more complicated.

ViewAlignBot

> [winNo]{Esc v b}

Essentially, this adjusts view to bring the current line to the bottom of the viewing window. If you have a guardband set (see %s=guardband) then the current line will not approach the top margin by fewer than the specified number of lines.

When there is only one window then that's all there is to it. When there are more windows, it's a bit more complicated.

ViewAlignMargin

> {Esc v m}

Shifts the view to bring the leftmost column of the text image into alignment with the left margin of the viewing window.

ViewLeft

> [<n>]{Ctrl+Shift+LeftArrow}

Shifts the buffer view n columns leftwards, n defaults to 1.

ViewRight

> [<n>]{Ctrl+Shift+RightArrow}

Shifts the buffer view n columns rightwards, n defaults to 1.

ViewUp

> [<n>]{Ctrl+Shift+UpArrow}

or

> [<n>]{Esc v u}

In the display, shifts the view up by n lines (defaults to 1) without changing the current line, character or selected substring. This function is also available as {Esc v u} for the benefit of windows users as {Ctrl+Alt+UpArrow} is blocked by windows.

ViewDown

> [<n>]{Ctrl+Shift+DownArrow}

or

> [<n>]{Esc v d}

In the display, shifts the view down by n lines (defaults to 1) without changing the current line, character or selected substring. This function is also available as {Esc v d} for the benefit of windows users as {Ctrl+Alt+DownArrow} is blocked by windows.

WindowShrink

> [<winNo>]{Ctrl+Alt+UpArrow}

or

> [<winNo>]{Esc w -}

Reduces the height of the specified [or current] window by 1 line. If the window ends up with a width of 0 or less, then the window is deleted.

Normally there will be only one window, where there is more than one window and no window number is specified then the first window displaying the current buffer is shrunk. Note that slices (vertically split screens) it is the width of the specified slice that is adjusted.

In some systems the {Ctrl+Alt+UpArrow} combination is a workspace switching shortcut. For the benefit of users affected by this there is the {Esc w -} escape sequence.

See also WindowStretch and WindowOne.

WindowStretch

> [<winNo>]{Ctrl+Alt+DownArrow}

or

> [<winNo>]{Esc w +}

Increases the height of the specified [or current] window by 1 line.

Normally there will be only one window, where there is more than one window and no window number is specified then the first window displaying the current buffer is stretched. Note that slices (vertically split screens) it is the width of the specified slice that is adjusted.

In some systems the {Ctrl+Alt+DownArrow} combination is a workspace switching shortcut. For the benefit of users affected by this there is the {Esc w +} escape sequence.

See also WindowShrink and WindowOne.

WindowDown

> {Esc w d}

WindowUp

> {Esc w u}

Essentially the same as WindowDown, above, except that it moves through the windows from right-to-left and from bottom-to-top.

WindowSave

> [<configName>]{Esc w s}

WindowSave will make a record of the current window configuration (actually in the form of a query screen report) and save it in a data object buffer. The optional ConfigName is used to define the data-object name - the default name is "default". It then calls WindowOne to give a basic single-window view.

If the given configuration name has already been defined, then the old window configuration is silently destroyed and replaced by the new one.

This function is designed to be used with WindowRestore which can be used to restore the original window configuration.

WindowWithLineNumbers

> {Esc w l}

Sets up a 6-column window slice to the left of the main window this slice displays the line numbers.

The line-numbers slice can be dismissed by invoking the WindowWithLineNumbers function once more or with the WindowOne function.

Note that this function is only set up to display line numbers for a simple window configuration. It works by configuring the windows as two slices and setting up a %S=On_Key command sequence which updates the line numbers after each user action.

WindowRestore

> [<configName>]{Esc w r}

WindowRestore will restore a previously-saved window configuration (see WindowSave). If the named window configuration does not exist, the function fails without making any changes to the window configuration.

As with WindowSave, the default window-configuration name "default".

WindowReassign

> <windowNo>[ <bufferKey>]{Esc w a}

Changes the buffer binding for the specified window. If a buffer key is given then the window is bound to that buffer otherwise the window is set to be floating - it displays whatever happens to be the current buffer.

ViewSave

> [<viewName>]{Esc v s}

This function makes a note of the current view, the view may be returned to using the ViewAgain function, you may save any number of such views by assigning each one a different name - in practice the number of views is limited by hashtable capacity.

To do this it sets up a jump object and a data object (see about hashtables) named ViewJump_<viewName> and ViewJump_FirstLine_<viewName> respectively in the code repository hashtable. Where <viewName> is the given viewname - this name, rather imaginatively, defaults to "default". The view can then be restored using the ViewAgain function.

Note that the ViewSave and ViewAgain functions will not always work for secondary buffers - the correct buffer has to be at the top of the stack for ViewAgain to work correctly.

In the event of a non-unique viewname, the new view silently replaces the original.

Many different views can be held by assigning each a unique name, the actual limit is set by the total capacity of the code-repository-buffer ( * ) hashtable, normally set to 1000, of which about 200 are used for the function names. View names may be of any length.

ViewAgain

> [<viewName>]{Esc v a}

This function restores a previously-saved view answering to the name <viewName>, as with ViewSave the default view name is "default".

The cursor returns to the same character number and line as was current at the time of the corresponding ViewSave operation. It also attempts to place that line in the same position on the screen as before - this element of ViewAgain will fail to accurately align the view if the line numbers have changed by inserting or removing lines above the view.

See also the note on secondary buffers in ViewSave.

Do Functions

This group of functions is about running jot command files.

Do

> [<pathName>]{F2}

Run a command file. The default path is your current working directory, if the named file does not exist there then it searches for it in ${JOT_HOME}/coms, the default file extension is .jot

ScriptByName

> [<string>]{Shift+F2}

Searches all scripts in ${JOT_HOME}/coms and your pwd for those with names matching the string. If no string given then lists all scripts with .jot name extension.

ScriptByFunc

> [<string>]{Ctrl+F2}

Searches the first-line comments of all scripts in ${JOT_HOME}/coms and your pwd for those with functions matching the string. If no string given then lists all scripts with .jot name extension and their first lines.

The popup-menu functions

The startup script defines PopupSearch and PopupIncrementalSearch - functions that search and list matching words in the popup menu. The popup can be driven by other functions and scripts (eg SpellcheckDocument - which uses it to pass spelling corrections suggested by Aspell). See also Using the popup menu for a quick tutorial on the popup.

Clicking on a popup-menu item launches "PopupMouseSelect" - the popup callback function which pushes the selected item back into the console area where it can be used as a parameter to any jot function that takes a string argument. It also clears the popup from the screen to get it back again call PopupRestore.

The two search functions "PopupSearch" and "PopupIncrementalSearch" both search the current buffer in different ways and report their results in the form of a popup menu. various functions defined by the NextMisspelling script also handle popup menus.

In the event of the popup menu being longer than the popup window, two popup-scrolling functions are provided PopupScreenNext and PopupScreenPrev.

Note that, for some versions of curses, mouse-clicks are not accurate right of, approximately, column 100. In these circumstances clicking on a popup beyond column 100 will result in this error message

{Command-sequence failed.(nnn)}%h=call PopupMouseSelect;

If this is a problem then two options are available:

PopupSearch

> <substring>{Esc p s}

This searches the current buffer for words matching the given string. Matching words (any string consisting of ASCII alphanumeric characters and underscores) are displayed in the popup menu and may be selected by a click of the left mouse button (see PopupMouseSelect).

PopupIncrementalSearch

> [<initialSearchString>]{Esc p i}

This performs an incremental search - incremental in the sense that it prompts and picks up your characters one at a time. As each new character is entered the document is searched for instances of revised search string updating the list of matching words in the popup as the search string grows. Characters may be removed with the backspace key.

The correct method of exiting the search loop is to hit {Return}. A {Ctrl+c} interrupt will also exit the function but will not enable mouse clicks and will leave the stack in an untidy state - you may have to clear the stack with the O@ command - see using the popup menu for an example of usage.

Note that, although the popup menu is visible while the incremental search is progressing, mouse events are disabled and are only re-enabled on exit.

When the optional initialSearchString arg is given, this sets the start point for the search string. This is useful when searching a very large document since it avoids the initial short search strings that can generate a great many matches - when searching large documents the function can be very slow and unresponsive without an initial search string as it filters and processes the results of these initial short search strings.

Each time a new character is entered it is appended to the search string and the whole file is scanned for words containing the revised search string. The list of matching words is displayed in the popup. If there are more matches than the popup has capacity to display them, Then use the PopupScreenNext and PopupScreenPrev functions to navigate in the popup menu - see the popup-menu functions. PopupIncrementalSearch reports the number of matching words in it's prompt string.

As usual, with jot popups, clicking on a popup line feeds that word into the console, where it can be used as an argument to any jot function that takes a text-string argument.

PopupMouseSelect

> {Left-click in popup menu}

This function is set up as the callback for a left-click event. It is used to identify one member of the currently-displayed words in the popup menu.

This function copies the selected item from the popup menu to the console command stream. Then it can be used by any function that picks up an argument from the console (e.g: Substitute, Insert, FindNext, etc). It would typically be used with the spelling checker to fix a detected misspelling, or any other function that generates a popup menu.

If there are more items in the menu than can be accommodated on the screen then use the PopupScreenNext and PopupScreenPrev functions. The PopupMouseSelect function also causes the popup menu to disappear, to make it reappear use PopupRestore.

PopupScreenNext

> {Esc p u}

or

> {Ctrl+Alt+PageUp}

Scrolls the popup window to reveal the page above the currently-visible page and reports current position.

PopupScreenPrev

> {Esc p d}

or

> {Ctrl+Alt+PageDown}

Scrolls the popup window to reveal the page below the currently-visible page and reports current position.

PopupRestore

> {Esc p r}

This restores the popup menu following a mouse-click event (see PopupMouseSelect) or can be called directly by some script that has set up something to be displayed as a popup menu.

A new popup menu must be predefined in the ( - ) buffer, in the form of a list of menu items with each item on a new line. This is usually done by some other jot function e.g. NextMisspelling, PopupSearch and PopupIncrementalSearch these functions then call PopupRestore. Items may contain whitespace but any leading or trailing whitespace is removed before display.

If no new popup is defined ( the ( - ) buffer is empty) then the last-used menu is used, this is held in the data object "*=PopupMenu".

The PopupRestore function is called by PopupSearch and by the NextMisspelling and NextSpellInstance, which offers suggested spelling corrections via the popup menu.

Mouse-Event Bindings

In Linux, where X-windows provides useful mouse functions, mouse-button events are all ignored by jot allowing them to be picked up by X-windows. In Windows, which has virtually no useful mouse actions, all normal mouse events are picked up by jot. This behaviour is defined in the startup script (see startup.jot) and can be changed by adopting a custom startup script.

NoteFromMouse

> {Button2Down} ({Button1Down} in windows).

This picks up and notes the the coordinates of the button-press and sets a note point there.

CopyFromMouse

> {Button2Up} ({Button1Up} in windows).

The note point is assumed to have been set by the Button-down event (see NoteFromMouse).This picks up and notes the coordinates of the button-release and abstracts from the current note point to the position indicated by the mouse at Button-Up time.

FocusToMouse

> {Button2DoubleClick}

This picks up and notes the coordinates of the button-press and sets the editor focus point to the position indicated.

InsertHereMouse

> {Button3Click}

This picks up and notes the the coordinates of the button-press and inserts the contents of the _ buffer there.

Mouse-Event Bindings - Windows

One of the many crosses born by windows users is the lack of useful mouse actions. Especially selections and most particularly in windows consoles. The functions described below are not anything like as useful as X-windows selections but there we are ... any port in a storm.

SelectionStart

> {Button1Down}

The mouse cursor position is noted - the real action takes place as the button is released.

SelectionEnd

> {Button1Up}

The new mouse cursor position is noted and, if it is on the same line as for the {Button1Down} event the text between the two points is copied to a selection buffer without affecting the editors cursor.

SelectionFree

> {Button1Click}

Any text in the selection buffer is deleted.

SelectionWord

> {Button1DoubleClick}

The mouse-cursor position is noted and, if it corresponds to a word in the text, then that word is copied to the selection buffer. In this context a word is deemed to be any string consisting of alphanumeric characters or underscores.

SelectionLine

- Not curreutly mapped to any button event.

Similar to SelectionWord except that it selects the entire line.

SelectionPut

> {Button2Click}

The position of the mouse cursor is irrelevant, the contents of the selection buffer is dumped into the command line.

Housekeeping Functions

Again

> [<n>]{F10}

Repeats last command or hotkey once by default or n times if n is specified if n is zero then the command is repeated to exhaustion.

AgainExhaustive

> {Shift+F10}

Repeats the last-given command until it fails and then reports the total number of iterations (including the original). Typically this might be used to determine how many instances of a string exist in the buffer.

It's left to the user to add one to the result provided (it's already done it once, remember).

Typically this might be used to count instances of a string in a buffer but it's completely general - it can follow WordRight to count words in a file, or it could follow Right to count bytes for example.

It's also left to the user to not attempt to use this on commands or functions that never fail. Insert, for example, will keep on inserting until something breaks - possibly the editor running out of memory and that might take some time.

InsertMode

> {Esc I n}

Enters insert mode, this mode persists until {Ctrl+c} or next {Esc I n}. See Insert mode and Command-mode vs. insert mode

TempInsertMode

> {Esc i n}

Temporarily enters (or exits) insert mode, this mode persists until next escape-sequence or function-key operation. See Insert mode and Command-mode vs. insert mode

If you are currently in insert mode - it temporarily exits for you to enter a command line to the console.

DebuggerQuit

> [<arg>]{Esc q}

Valid options for the arg are as follows:

Of all the functions which take a parameter, DebuggerQuit is the only one that does not prompt in screen-edit mode. This is because passing the parameter in the ( $ ) buffer will corrupt whatever is in that buffer for the code being debugged.

CmdEditStart

> {Esc c e}

Switches from your current view to a list of recent commands followed by whatever you might have been typing to the console. By default only the last 20 commands are saved this limit can be changed with the -History command-line qualifier.

Select one of these command lines for re-execution by placing the cursor anywhere in the line and invoking CmdEditGo. The line can be edited if necessary using normal editing functions - see about command editing.

CmdEditGo

> {Esc c g}

Returns from the command-edit screen (see CmdEditStart) to your original context and leaves the selected command string in the console - (see about command editing).

CmdStringDefine

> [<CmdStringName>] <CmdString>{Esc c d}

This defines a command string to be recalled and inserted by the function CmdStringInsert, if the optional name is omitted the name is set to "default".

Note: The simple syntax of this command implies that, when the name is not given, the command string must not contain blanks.

CmdStringInsert

> [<CmdStringName>]{Esc c i}

This is a labour-saving feature that allows the definition and use of long, complicated or hard-to-remember strings and inserts them in the command stream where they can be used for any purpose - typically a long word to be inserted or maybe some complicated proximity-search expression.

CmdString

> <JotCommandString>{Esc c s}

This is only useful when the editor is being used in insert mode. It offers a route for manually-entered commands. In insert mode the escape sequence is typed in first, then the command string is entered in response to a prompt - see Basic Commands.

CompareBufs

> [<BufferKey>]{<CommandString>}{Esc c b}

Performs a simple record-by-record comparison of the contents of the current buffer with that of the nominated buffer. Subsequent calls need not specify the comparison buffer.

Comparison starts at the current record in each buffer and continues until there's either a mismatch or it encounters the end of one of the buffers.

When the command string is specified the command string is applied to both buffers and no comparison is performed, this may be used to initialize or to re-synchronize the buffers. In order ambiguity, the command string must be at least two characters long.

See also comp.jot.

AddNewFunctions

> %h=call AddNewFunctions;

This function is used by jot scripts to add new functions to the code repository. It assumes that the new functions have been defined by appending to the code-repository buffer ( * ). This is normally done with the %G command with the -append qualifier. The -append qualifier causes %G to exit at the start of the first of the new functions. AddNewFunctions then updates the code repository hash table starting with the first of your new functions.

The new functions may require hot-key triggers. To associate symbolic hot-key (e.g. {Ctrl+Shift+F1} add these to the escape-sequence field of the key-code buffer ( ^ ) and the AddNewFunctions function will substitute the correct keycodes.

For an example of usage look at ${JOT_HOME}/coms/get.jot.

Macros 0 to 9

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

The buffers 0-to-9 may be used for any purpose but, when used to define macro commands, are available to windows users with numeric keypads when {Num Lock} is set. For such users each of these macros is available as a single keystroke - macro 0 being attached to Numeric-key 0, etc.

For linux users with a numeric keypad wanting single-keystroke access to these macros, they will have to adjust their key mapping - see X-windows setup.

For those without a numeric keypad or linux users that don't want to change their xmodmap entries, these macros are available as {Alt+0}, {Alt+1}, ...