home *** CD-ROM | disk | FTP | other *** search
- Documentation for Line Editor Module V2.30
- ------------------------------------------
-
- ********************* Very boring Copyright Notice ********************
- * *
- * The source code, binary and documentation for the Line Editor are the *
- * exclusive copyright of Richard K. Lloyd and are freely distributable, *
- * provided this notice is left intact. *
- * *
- *************************************************************************
-
- Introduction
- ------------
-
- For compatibility with the BBC Micro command line, Acorn has kept the
- COPY key method of repeating a previous command when developing the OS_ReadLine
- interface for the Archimedes. As far as I can see, the COPY key method has only
- ONE advantage - it's easy to join bits of text together from different lines on
- the screen. It has NO OTHER ADVANTAGES, so I set about fixing this by writing
- a command history interface to OS_ReadLine as a module. So what extra goodies
- does this give you over the COPY key system ? Here's a list...
-
- * Lines can be recalled long after they have disappeared from the screen
- * Editing is possible in the middle of a line rather than just at the end
- * Insert & overtype mode are available (now reflected in the cursor shape)
- * Shift-delete deletes to the right (impossible with the COPY system)
- * Lines can be recalled by matching their start uniquely (using ~substring)
- * Up to 255 lines can recalled and only unique lines are stored
- * Cursor navigation can use Shift or Ctrl to jump words or to edge of line
- * Optional reversion to the COPY system if you need it for a single line
- * The Line Editor is the ONLY Archimedes program I know of that supports
- filename completion
-
- Machine Requirements
- --------------------
-
- The LineEditor module can be run on ANY Archimedes with (typically) 12K
- of RMA to spare and will remain active after a soft reset, whereas the
- !RunImage front-end requires RISC OS and 24K of application workspace
- (on top of the 12K of RMA needed for the module) and currently doesn't
- survive a soft reset or Desktop exit.
-
- Distribution Files inside the !LineEdit directory
- -------------------------------------------------
-
- 1. !LineEdit.!ReadMe - This file
- 2. !LineEdit.!Run - Installs Line Editor and runs !RunImage front-end
- 3. !LineEdit.!RunImage - BASIC Desktop front-end for setting EdSize/EdLines
- 4. !LineEdit.!Sprites - Silly Line Editor icon for the Desktop
- 5. !LineEdit.CompDoc - Documentation for Filename Completion
- 6. !LineEdit.Completion - Library source code for Filename Completion
- 7. !LineEdit.EditSrc - Line Editor module main source code
- 8. !LineEdit.Example - Example BASIC/ARM program to use Completion code
- 9. !LineEdit.History - Separate Revision History file for the Line Editor
- 9. !LineEdit.LineEditor - Assembled Line Editor module binary
- 10. !LineEdit.Templates - Template file (!FormEd-created) for Info dialogue
-
- V2.20 onwards now comes with a very 'noddy' front-end for the configuration of
- the EdCursor, EdSize and EdLines values - just double-click on the !LineEdit
- icon inside the Desktop and the values can be changed from the menu of the icon
- bar icon. The *EdStatus, *Recall and *EraseHistory commands are also on the
- same menu for ease of use.
-
- Note: Quitting this front-end via its own Quit menu option will *RMKill
- the Line Editor module. Quitting with Shift-Ctrl-f12 or via the
- Task Manager Task Quit, however, does NOT *RMKill the module.
-
- To reassemble the Line Editor (preferably outside the Desktop - I wish that
- opening a Filer window would change the current directory to that window !),
- *Dir into the !LineEdit directory and then type '*EditSrc'.
-
- Note: If you exclusively use the Line Editor OUTSIDE the Desktop, then you'll
- only need !LineEdit.LineEditor, so copy that into your Library directory
- and start it up by typing '*LineEditor'. However, it you do start the
- Line Editor module outside of the Desktop, then the *Configure EdSize
- value should not exceed the amount of free RMA available.
-
- Because the Line Editor traps the OS_ReadLine vector, the following will be
- intercepted :
-
- a) BASIC's immediate command mode (prompted by a ">").
- b) BASIC's INPUT and INPUT LINE statements.
- c) The Supervisor's line input (default prompt is a "*").
- d) Any ARM code or 6502-emulated code (inc. BASIC 4.31) that calls OS_Word 0.
- e) Any ARM code that calls OS_ReadLine (a bit obvious this one...).
-
- The *Configure EdCursor command
- -------------------------------
-
- Syntax: *Configure EdCursor <value>
-
- This command sets the type of text cursor shown when the Line Editor is active.
-
- Possible legal values are:
- 0 -> Flashing & underline (Default system cursor)
- 1 -> Flashing & block
- 2 -> Steady & underline
- 3 -> Steady & block
-
- The new value is saved to bits 6 and 7 of battery-backed RAM location 38 and
- takes effect immediately. Note that the toggling of Insert/Overtype mode with
- the use of the Insert key now toggles the shape of cursor too (between
- underline and block). When the Line Editor module is killed, the default system
- cursor (value = 0 above) is restored.
-
- The *Configure EdLines command
- ------------------------------
-
- Syntax: *Configure Edlines <lines>
-
- This command sets the number of lines in the command history buffer. If the
- parameter is outside the range 2 to 255 lines, then a default value of 30
- lines is used instead. The new value is saved to battery-backed RAM location
- 37 and takes effect immediately (may clear command history buffer).
-
- The *Configure EdSize command
- -----------------------------
-
- Syntax: *Configure EdSize <kilobytes>
-
- This command sets the size of the command history buffer. The parameter states
- the number of kilobytes that are to be allocated. If it is outside the range
- 1 to 63 kilobytes, then a default value of 4 kilobytes is used instead. The
- new value is saved to bits 0 to 5 of battery-backed RAM location 38 and takes
- effect immediately (may clear command history buffer).
-
- The *EdStatus command
- ---------------------
-
- Syntax: *EdStatus
-
- This command displays a table of the CURRENT command history usage. Of course,
- typing this command will change the values !
-
- The *EraseHistory command
- -------------------------
-
- Syntax: *EraseHistory
-
- This command clears the command line history buffer. It is provided for use
- inside programs rather than actually at the command line itself, because
- Ctrl-Delete is a lot easier to type...
-
- The *Recall command
- -------------------
-
- Syntax: *Recall
-
- This command displays the current contents of the command history buffer.
-
- Line Editor Controls (the list below can be displayed with "*Help Editor")
- --------------------
-
- The keys supported in the Line Editor are as follows :
- Escape or Ctrl-[ : Abandon current line and do not insert in buffer.
- Tab or Ctrl-I : Filename completion (beeps if no unique match).
- Insert : Toggle insert and overtype modes for one line only.
- Copy : Allow normal screen copying for one line only.
- Shift-Insert : Clear and remove single line from history.
- Shift-Delete : Delete character directly under cursor.
- Ctrl-Delete : Clear line and erase entire history.
- Cursor Up : Cycle backwards through previous commands.
- Cursor Down : Cycle forwards through previous commands.
- Cursor Left : Move cursor one character to the left.
- Cursor Right : Move cursor one character to the right.
- Shift-Cursor Left : Move cursor to end of previous word.
- Shift-Cursor Right : Move cursor to start of next word.
- Ctrl-Cursor Up : Recall the oldest previous command.
- Ctrl-Cursor Down : Recall the newest previous command.
- Ctrl-Cursor Left : Move cursor to start of line.
- Ctrl-Cursor Right : Move cursor to end of line.
- Backspace or Ctrl-H : Identical to Delete.
- Ctrl-J or Ctrl-M : Identical to Return.
- Ctrl-U : Clear entire line.
- All other control codes are echoed to the screen, but not put in buffer.
- ~<substring> recalls command whose start uniquely matches <substring>.
-
- Filename Completion
- -------------------
-
- Please read the "CompDoc" document for details.
-
- Substring Recall
- ----------------
-
- A new feature with V1.02 onwards is the ~<substring> facility. This recalls a
- particular command, providing the start of the command matches <substring>
- UNIQUELY (take note, Gary !).
-
- For example, if the following commands were typed in:
-
- Command 1 - *Help Commands
- Command 2 - *Mount 0
- Command 3 - *Info *
- Command 4 - PRINT"HELLO"
-
- Then the ~<substring> system could be used as follows:
-
- ~P would recall PRINT"HELLO"
- ~*M would recall *Mount 0
- ~*h would recall *Help Commands because the system is case insensitive
- ~* would leave the ~* in place because there is no unique match
- ~*Z would leave the ~*Z in place because there is no match at all
- ~*Info *.c would leave the ~*Info *.c in place because the command string
- is longer than *Info *
-
- Note: The last example is clearly a recalled command that's been edited,
- because normally expansion would have taken place after the ~*I had been typed.
-
- If there is no recall match when RETURN is pressed, then the leading tildes
- are stripped off and the command is executed as if the tildes weren't specified
- at all.
-
- This recall system is roughly based on the !! system of some UN*X shells, but
- is better in my opinion because it expands BEFORE RETURN IS PRESSED.
-
- History Buffer Management
- -------------------------
-
- There is a (now nice) piece of logic in the Line Editor code that will purge
- the oldest commands if the command history is almost full. If a line is typed
- in which already duplicates one in the command history, then the latter is
- removed and the duplicate line is put in the last command history slot.
-
- Memory Usage (changed with V2.21 onwards)
- ------------
-
- Type 1 Unit Min. Units Max. Units Default Units CMOS RAM
- ==== ========== ========== ========== ============= ========
- EdLines 4 bytes 2 255 30 Loc 37
- EdSize 1024 bytes 1 63 4 Loc 38 (bits 0-5)
-
- Hence the default memory usage (claimed from the RMA) is:
-
- EdLines = 30 * 4 = 120
- EdSize = 4 * 1024 = 4096
- Completion = 77 * 12 = 924
- Total = 5140 bytes
-
- The Line Editor vs. The !Edit Task Window
- -----------------------------------------
-
- Unlike versions prior to V2.20, the Line Editor now co-exists with the !Edit
- Task Window without crashing the machine. HOWEVER, I've discovered that trying
- killing the !Edit Task Window with the Line Editor installed DOES NOT actually
- kill that Task Window and it cannot be killed without shutting down the
- Desktop !
- My advice is to avoid the combination of the two if at all possible because
- the Line Editor isn't available inside the !Edit Task Window anyway. If you
- really *must* run the two together, then twiddle the 'Next' memory bar in the
- Task Manager to, say, 80K or 100K otherwise ALL of the application memory will
- be grabbed when you next select 'Create Task Window' in !Edit - hence locking
- out that memory because of the clash.
-
- The Line Editor vs. Twin Tasks
- ------------------------------
-
- Again, V2.20 onwards of the Line Editor is a lot more stable than the previous
- versions and will not crash the machine during a Twin background task.
- HOWEVER, strange behaviour (due to a mixture of command recall and Twin
- editing) can occur if arrow keys are used during a Twin background task.
-
- Revision History
- ----------------
-
- Please read the "History" document for details.
-
- Future Improvements to Line Editor V2.30
- ----------------------------------------
-
- Only bug-fix releases are planned from now on. If someone suggests a new
- feature that's easy to implement, then I may consider it but otherwise I
- intend to freeze this core of this project at V2.30.
-
- Where to find me to report bugs or improvements to the Line Editor
- ------------------------------------------------------------------
-
- Snail Mail JANET e-mail
- ---------- ------------
- Richard K. Lloyd, rkl@uk.ac.liv.cs.and
- 1, Banks Road,
- Lower Heswall,
- Wirral,
- Merseyside.
-