A Programmer's Editor | |||
e93 Manual | |||
e93 is a portable window based text editor oriented to the needs of programmers. It was written to take advantage of the windowing systems found on today's workstations, and high-end PCs. e93 is based on the Tcl scripting language, and relys on this language for most of its high level functionality. e93 supports a model of editing which emphasizes limiting the number of modes, and maximizing the use of a small, easily learned set of editing commands. To install e93, please read the file "INSTALL" that came with this distribution. NOTE: Since e93 is portable, I have attempted to keep this manual machine/OS independant to a reasonable extent. However, since e93 was first written for UN*X machines, there is a slight bias towards them in this documentation.
To start e93 from a command line interface (if your machine/OS has one), type: e93 <fileToEdit> <fileToEdit> ... e93 will start up, and open all of the specified files for editing. There are no command line options, just filenames.
When e93 opens a file for editing, it reads the contents of the file into a "buffer", and then closes the file. All editing takes place within the buffer, and changes are not written back to the file until the buffer is "Saved". A buffer is an area of memory where text is stored while it is being edited. Buffers can contain arbitrary amounts of text, and do not place any limits on the characters they contain (ASCII \0 is allowed in a buffer). Although buffers are usually used to hold the contents of files, they are also used to hold other things, like new documents, clipboards, and the text that is used by the Find and Replace functions. All buffers have names. These names are needed so that buffers can be referred to from Tcl scripts. The name of each buffer must be unique. buffer names can be of arbitrary length, and can contain any character except '\0'. A buffer open to a file is typically named with the full path name of that file. Buffer names are case sensitive. Buffers can have "windows" associated with them. A window can be thought of as a view onto the contents of a buffer. Windows are where most editing commands are carried out. It is important to understand that buffers do not NEED to have windows associated with them. In fact, certain buffers (like clipboards) typically are not associated with windows. Each window on the other hand, is always associated with a buffer. Windows also have names, and each takes the name of the buffer it is associated with. Many of the features of a window can be changed from Tcl scripts. Some of these are:
e93 maintains the concept of an "active window". This is the window that is top-most. Most menu commands operate on the active window. Each window has a "Status bar" which gives useful information about the buffer being edited. The status bar indicates if a buffer has been modified, how many lines of text it contains, how many characters of text it contains, and gives information about the current cursor/selection position. Also, if there is a task running in the window, the status bar will let you know.
The cursor is a small flashing vertical line that appears in the text of the active window. Its position indicates where the next editing operation will take place. e93's editing model considers the cursor to be akin to a selection of 0 characters. By contrast, in some editors, you can have both a cursor, and a selection active simultaneously. In e93, the selection and the cursor are really the same thing, so if you have a selection, that IS your cursor.
e93's selection mechanism is one of its more distinguishing features. At first glance, e93 selects text in the same way as many other modern editors, namely: To select text for cut, copy, paste, or other operations, first move the mouse pointer to the position where the selection should begin, click the left button, and while holding it down, drag the mouse pointer to the end of the desired selection. The process "highlights" the selected text (by drawing it in inverse colors). The highlighted selection can then be operated on by a number of editor functions. e93 also supports word, line, and document selection by double, triple, and quadruple clicking respectively. (Double clicking is clicking the mouse button twice in rapid succession). If you double click, holding the left button down after the second click, e93 will the select words as you drag the mouse along. This also works for lines when triple clicking. To adjust a selection, hold down the shift key on the keyboard, and click the left mouse button in the document. This will either enlarge, or reduce the current selection, depending on where you click. Clicking outside the current selection will enlarge it so that it extends to the point where you clicked. Clicking inside the selection will reduce it by pulling the nearest edge in to the point where you clicked. You can also shift-double, shift-triple or shift-quadruple click, and get the expected results.
Segmented Selection
Columnar Selection NOTE: although a columnar selection looks rectangular to you, it is important to understand that e93 does not really think of it that way. As far as e93 is concerned, a columnar selection is nothing more than a discontinuous selection which spans pieces of the text. (In this case, a small portion of one line, followed by a portion of the line below it, and so on...) This distinction will become important as operations that work on selections are discussed.
Sometimes it is desirable to remember a given place in the text, and be able to return to it later. Most editors refer to this feature as "marking", or "book-marking". In e93, marks do not simply remember a place in the text. Instead, they remember an entire selection. e93 allows for an arbitrary number of marks of arbitrary complexity. As you edit the text, e93 attempts to update each mark so that it points to what it used to, even though you may be making modifications above or in the text which is marked. The default .e93rc file sets things up so that marks can be set in a buffer by typing CMD-F1 through CMD-F4 on the keyboard. The respective mark can be recalled by F1 through F4.
Like other editors, e93 supports Cut, Copy, and Paste. When the selected text is Cut from a buffer, it is removed from that buffer, and placed into another buffer referred to as the "clipboard." When the selected text is Copied from a buffer, it is not removed, but is just copied into the clipboard. Each time a Cut or Copy operation takes place, the text that is placed into the clipboard completely overwrites the text that was there. Once you have text in the clipboard, it can be placed into another buffer by pasting. Pasting does not destroy the contents of the clipboard. The clipboard in e93 is nothing more than a buffer which has been designated as the clipboard. It is possible to designate any buffer as the clipboard, and it is also possible to switch on the fly. This allows e93 to support an arbitrary number of clipboards. The default .e93rc creates 10 buffers to be used as clipboards, and provides menu operations to switch between these buffers.
NOTE: clipboard buffers in e93 do not typically have windows open onto
them, but it is possible, and sometimes desirable to attach a window
to a clipboard. The command to open a window onto clipboard 0 would
be: OpenDefaultWindow clip0 NOTE: the command opendefaultwindow is not a command built into e93, instead, it is a Tcl procedure, defined in the .e93rc file (described below). Cut, Copy, Paste, and fun with Segmented Selections Since e93 allows a selection to have "holes" in it, Cut, Copy, and Paste take on a slightly different flavor than in most other editors. When a selection is Cut, or Copied, the text of each segment of the selection is placed into the clipboard sequentially. As each segment is placed into the clipboard buffer, it is also selected as a segment in the clipboard buffer. The result is a clipboard that not only contains the pieces of text that were selected, but also one that remembers where each piece begins and ends (since each piece is selected individually in the clipboard). When text is pasted from the clipboard, each segment is pasted individually. The process works as follows: Each selection in the clipboard is pasted over over each selection in the document until e93 runs out of selections in the clipboard or document. If there are no more selections in the document, then the remaining clipboard selections are pasted columnarly with each successive segment placed into the line immediately below the previous one..... If there are no more selections in the clipboard, then the remaining selections in the document are deleted. NOTE: e93 does not care how selections were placed into the clipboard. It always pastes them in this columnar fashion. Also note that in the case of a selection with just one segment (no discontinuity) that the paste operation works exactly as it would in an editor without segmented selection.
e93 utilizes the Tcl scripting language. This allows it great flexability. Users of e93 are able to write scripts to perform complex editing tasks, as well as use them to configure the editor to personal taste. When e93 starts, it attempts to locate a file with the name .e93rc (some implementations use slightly different names). This file is meant to contain a Tcl script. The script is charged with the task of setting up all menus, key bindings, and defaults that will be available when the editor starts. It is also the responsibility of this script to interpret all of the command line parameters passed to e93. That includes opening any files present on the command line. Without this script, e93 would not do very much. Therefore, if the script cannot be located at startup, e93 will complain, and quit. This script is the primary means by which e93 is customized to the taste of the user. Given the number of things defined by this script, a fair amount of customization is available, but at the cost of some complexity. Once e93 has started, Tcl commands may be executed by typing them into any window, and pressing the enter key on the numeric keypad. The results of the command (if they are not piped elsewhere) are then placed into the window.
If you are viewing this file from within e93, do the following:
Place the cursor anywhere on the following line, and press keypad
enter: beep; okdialog {Hmmm, that was interesting} You should hear a beep, and then a dialog should pop up with a useless message in it. This works, because the .e93rc script has bound the keypad enter key to a function that grabs the line the cursor is on (or the currently selected text), and sends it to Tcl for processing. The list of built in commands that e93 currently understands is given in the appendix.
e93 separates the keyboard into three types of keys:
There are 11 modifier keys defined by e93:
The character keys are a-z, numbers, tab, escape, return, etc... These are the keys which would be expected to insert a character when typed. The function keys are:
When no keys are bound (See the section on Key binding below), e93 relys on a default set of bindings that are "hardwired" into the code. NOTE: key bindings can be used to override this default behavior. Here is a list of keys, and default actions: All unmodified, or shift modified characters are inserted into the active window. All control modified characters are inserted into the active window (e93 does not treat the control key specially by default, since programmers often want to be able to enter control sequences into text with a minimum of bother).
Unmodified Arrows move the cursor up/down by line, left/right by character. Page up, Page down move the cursor up or down by a page. Shift can be used with the page up/down to expand or reduce the selection.
Home, and End move the cursor to the start or end of a line.
Unmodified Backspace deletes the character to the left of the cursor.
Unmodified Delete deletes the character to the right of the cursor. Return does an autoindent (except in some dialog windows where it selects the "Ok" option). NOTE: if you wish to place a new-line character into the text of a dialog window, type <Control> J. Tab inserts a tab (except in some dialog windows where it may move between fields). NOTE: if you wish to insert a tab character into the text of a dialog window, type <Control> I. Escape inserts an escape (except in some dialog windows where it selects the "Cancel" option). NOTE: if you wish to insert an escape character into the text of a dialog window, type <Control> [. Cut, Copy, Paste, Undo, Redo (if you have these keys) perform their respective actions.
Menus are used to place functions that are executed often in a convenient place where they can be accessed quickly. The menuing system in e93 is dynamic. Menus can be added or deleted at any time. There are two Tcl commands used to add/delete menus:
Examples: addmenu {} LASTCHILD 1 "Test" {\KA} {okdialog "Testing 123"} This command adds a menu at the end (LASTCHILD) of the root menu {}. The new menu is called Test, it has a keyboard equivalent of CMD-SHIFT-a, and when selected, it will bring up a dialog box with a test message in it. NOTE: if you are viewing this file from e93, place the cursor on the example line above, and press keypad enter. You should see the menu item being added to the menu bar.
To delete the menu: deletemenu {Test} The appendix contains a more detailed description of these commands. Keys can also be bound to functions within e93. Key binding is much the same as defining menus. The major difference is that key bindings have no visual representation (as in a menu item that the user can see). Also depending on the implementation of e93, key bindings may be more versatile than menu key equivalents, allowing a richer set of key combinations to be bound to functions. For example, in the X windows version of e93, menu key equivalents only function when the command key is pressed, but bound keys can be bound to virtually all combinations.
There are two major key binding functions:
bindkey F5 00000000000 {okdialog "Testing 123"} To get rid of the binding: unbindkey F5 00000000000 All those 0s are called the "modifier string" they tell which modifier keys should be in which states for the binding to take effect. In this example, no modifiers can be pressed when F5 is pressed if the binding is to take effect. As usual, see the appendix for a more detailed description. NOTE: the key binding, and menu key equivalent functions are completely separate. If you define a menu that has a key equivalent, and also bind that combination of keys to some other function, e93 does not guarantee which will take precedence, only that one of them will be executed, and not both.
e93 performs search and replace like most other modern editors, with the following exceptions: Find All e93 remembers undo/redo information only for operations which change the text of a buffer. It does not remember cursor movements, or selections. Unlimited amounts of undo information are recorded separately for each buffer. e93 groups multiple contiguous character insertions and deletions so that they become single undo items. Each time you undo in a buffer, e93 remembers what was undone as redo information. However, once you make a change in a buffer, all redo information is lost.
|
|||
Appendix | |||
This appendix lists the Tcl commands which are implemented by e93, and gives a short description of each. These are in logical, not alphabetical order.
newbuffer bufferName Create a new buffer with the name bufferName. If bufferName already exists, this will return an error.
openbuffer pathName
closebuffer bufferName
savebuffer bufferName
savebufferas bufferName newPath
savebufferto bufferName newPath
revertbuffer bufferName
isdirty bufferName
fromfile bufferName
haswindow bufferName
cleardirty bufferName
bufferlist
windowlist
openwindow bufferName x y w h fontName tabSize foregroundColor backgroundColor
closewindow windowName
setrect windowName x y w h
getrect windowName
setfont windowName fontName [styleIndex]
getfont windowName [styleIndex]
settabsize windowName tabSize
gettabsize windowName
setcolors windowName foregroundColor backgroundColor [styleIndex]
getcolors windowName [styleIndex]
buffervariables bufferName
setbuffervariable bufferName variableName variableText
unsetbuffervariable bufferName variableName
getbuffervariable bufferName variableName
settopwindow windowName
activewindow
updatewindows
screensize
addmenu menuPathList relationship active menuName menuModifiers menuFunction Add a menu to the menu tree.
deletemenu menuPathList ?menuPathList ...? Delete the menus at the end of menuPathList. (e.g. to delete all menus, use deletemenu {})
bindkey keyName modifiers keyFunction
unbindkey keyName modifiers unbindkey F5 00100000000
keybindings
waitkey
getkey
undotoggle bufferName If there is redo information for bufferName, redo. If not, then if there is undo information for bufferName, undo. If not, return an error.
undo bufferName
redo bufferName
breakundo bufferName
flushundos bufferName
cut bufferName ?clipboardbuffer?
copy bufferName ?clipboardbuffer?
columnarpaste windowName ?clipboardbuffer?"
paste bufferName ?clipboardbuffer?"
getclipboard
setclipboard clipboardbuffer
unsetclipboard
textdialog dialogTitle ?initialText? Open a text entry dialog, with dialogTitle, and if specified, place initialText into the dialog. If the user exits the dialog with Ok, return the text that was entered. If he exits with cancel, return an error.
listdialog dialogTitle inputList
opendialog dialogTitle ?initialText?
savedialog dialogTitle ?initialText?
pathdialog dialogTitle ?initialText?
okdialog dialogText
okcanceldialog dialogText
yesnodialog dialogText
fontdialog dialogTitle ?initialFont?
searchdialog dialogTitle findbuffer replacebuffer backwardsVar wrapAroundVar selectionExprVar ignoreCaseVar limitScopeVar replaceProcVar
find searchInbuffer findbuffer backwards wrapAround selectionExpr ignoreCase Attempt to locate the text contained in findbuffer in searchInbuffer. If backwards is TRUE, search backwards. If wrapAround is TRUE, wrap the search around the end of searchInbuffer. If selectionExpr is TRUE, treat findbuffer as a regular expression. If ignoreCase is TRUE, ignore case during the search.
findall searchInbuffer findbuffer backwards wrapAround selectionExpr ignoreCase limitScope
replace searchInbuffer findbuffer replacebuffer backwards wrapAround selectionExpr ignoreCase replaceProc
replaceall searchInbuffer findbuffer replacebuffer backwards wrapAround selectionExpr ignoreCase limitScope replaceProc
selectall bufferName Select all of the text in the given buffer.
selectedtextlist bufferName
selectline bufferName lineNumber
getselectionends bufferName
setselectionends bufferName startPosition endPosition
setmark bufferName markName
clearmark bufferName markName
gotomark bufferName markName
marklist bufferName
homewindow windowName ?position? ?STRICT|SEMISTRICT|LENIENT?
gettopleft windowName
settopleft windowName topLine leftPixel
textinfo bufferName
selectioninfo bufferName
positiontolineoffset bufferName position
lineoffsettoposition bufferName lineNumber offset
movecursor windowName relativeMode
delete windowName relativeMode
expandselection windowName relativeMode
reduceselection windowName relativeMode
clear bufferName Delete all selected characters in bufferName.
insert bufferName textToInsert
insertfile bufferName pathName
autoindent bufferName
setwordchars wordCharacters Set the editor's understanding of which characters are considered part of words, and which are not. wordCharacters is a string containing all of the characters to be considered parts of words. The editor uses this information when double clicking, and when moving the cursor in a relative direction by word.
getwordchars
execute bufferName script
task bufferName taskData
updatetask bufferName
eoftask bufferName
killtask bufferName
hastask bufferName
beep
checkbuffer bufferName
forceQUIT
version |
|||