RIDGE ROS Text Editing Guide
Total Page:16
File Type:pdf, Size:1020Kb
ROS Text Editing Guide RIDGE 9051 'A ROS Text Editing Guide RIdge Computers Santa Clara, CA first edition: 9051 (SEP 84) © Copyright 1984, Ridge Computers. All rights reserved. Printed in the U.S.A. PUBLICATION HISTORY Manual TItle: ROS Text Editing Guide first editon: 9051 (SEP 84) NonCE No part of this document may be translated, reproduced, or copied in any form or by any means without the written permission of Ridge Computers. The information contained in this document is subject to change without notice. Ridge Computers shall not be liable for errors contained herein, or for incidental or consequential damages in connection with the use of this material. ACKNOWLEDGEMENT This software and documentation is based in part on the fourth Berkeley Software Distribution, under license from the regents of the University of California. We acknowledge the following individuals for their part in its development: Ken Arnold, Rick Blau, Earl Cohen, Robert Corbett, John Foderaro, Mark Horton, Bill Joy, Randy King, Jim Kleckner, Steve Levine, Colin McMaster, Geoffrey Peck, Rob Pike, Eric Scott, and Eric Shienbrood. These tutorial guides are based on documents created at Bell Laboratories to describe UNIX System software, and at the University of California, Berkeley, to describe bsd 4.2. Credits are given on the first page of each document contained in this volume. Some text has been changed to more accurately describe Ridge Computers' implementation of the software. Inappropriate material may have been deleted. UNIX is a trademark of Bell Laboratories. -ii- 9051 PREFACE The ROS Text Editing Guide (manual 9051) is a collection of tutorial documents on text,. editing software available with the Ridge Operating System. These sections supplement the editor reference pages in the ROS Reference Manual (9010). TABLE OF CONTENTS Tab ROS Reference Label Manual Page RED IT - Ridge Editor redit( 1) ED - ED editor ed( 1) Advanced ED - more on ED ed( 1) EX ref - EX editor reference section eX(1) EDIT - EDIT editor edit( 1) EX JED IT - EX and EDIT combined reference ex( 1), edit( 1) VI - VI editor introduction vie 1) VI ref - VI editor reference section vie 1) SED - Stream Editor sed( 1) 9051 -iii- -iv- 9051 REDIT - Ridge Text Editor Reference Manual CHAPTER I INTRODUCTION This manual documents redit, the Ridge text editor. An explanation of each of the com mands and operations is given, as well as a short tutorial. This manual also explains differences encountered between the Ridge Monochrome Display and the Text Terminal (Televideo 950). After having read this document, the reader should be able to create and edit files using redit, using either type of terminal. No knowledge of the Ridge 32 system on the reader's part is assumed beyond a minimal acquaintance with the operating system. The reader is referred to the R£dge Operat£ng System (ROS) Reference Manual for such basic operating system information as particu lars of file and directory structure, and allocation information for discs. OVERVIEW The Ridge text editor, redit, is a full-screen, strikeover editor that allows the user to create and modify text files. This chapter briefly describes redit and discusses file struc ture and types, display formats, and selected blocks and windows. Redit combines the attributes of a screen- and a line-oriented editor in such a way that the user can define and modify entire blocks of text while retaining control over indivi dual line operations. Screen-oriented attributes allow such features as windows and powerful block commands. The combination of these features allows the user simultane ous access into different areas of a file or multiple files (Figure 1). Line-oriented attri butes allow the user to perform operations such as insert/delete line or character, or search-and-replace with various options, as well as to build user-definable command files that execute complex/repetitive editing functions. Redit is not a formatting program; post-processing (with nroff, for example) is necessary to format output. Nor is redit a multiple mode editor; the editor is always in strikeover mode. Changes or alterations are made by overwriting text directly on the display. ·9051A -1- Text Editing REDIT Screen Movable Window Text File Figure 1. Windows on Text File Editing is performed using function and other editing keys, and through commands entered on the command line. (Virtually all keyboard keys function normally with reclit -e.g., backspace moves one character left.) Editing capabilities are thus broken into two groups: • EDITOR COMMANDS With this group, the liser enters the command into the command entry area (top line) of the screen. • PREDEFINED OPERATIONS These operations are invoked directly by function keys. The predefined operations have been imple mented using various combinations of the editing commands, and represent the most commonly used editing tasks. GENERAL DESCRIPTION This section describes the logical structure of text files, ASCII and work files, screen for mats, and the concept of selected blocks and windows. Logical Structure of Text Files A text file consists of a set of records referred to as lines. Each line has a length attri bute; the length describes the position of the last non-blank character in the line. The length of a line may range from zero (0) to 128 characters. A length of zero denotes a blank line. -2- 9051A Text Editing REDIT Each line can be identified by its position relative to the beginning of the file. The posi tion (line number) has a value in the range of 0 to 99,999,999, inclusive. Lines are effectively renumbered if preceding lines are inserted or deleted. Ascn Files and Work Files "ASCII file" refers to a file that is directly readable by such Ridge subsystems as the editor, language compilers, and utility programs. When an existing ASCII file is to be edited, the file is first copied to a "work file." The work file provides rapid, random access to any place in the text; this file is not directly readable by other Ridge subsys tems. During the editing session, changes to the text are made only to the work file, not to the ASCII file. At the end of the editing session, the text portion of the work file is copied to a new ASCII file. The work file is saved by default between editing sessions, which provides three benefits: time spent copying the ASCII file to the text file at the beginning of the editing session is eliminated, some contextual information (such as current position in the file and tab settings) is maintained across editing sessions, and the work file is an additional backup to the ASCII file. (Chapter 3 explains how to save a "lost" work file. In the user's directory, the work file bears a ".e" extension to the original ASCII file name. So, for an ASCII source file named "prime.s", a work file named "prime.s.e" is created. Screen Format The Ridge system supports two terminals: the Ridge Monochrome Display and the Text Terminal (Televideo TVI-950C). The Monochrome Display is bit-mapped and a range of font sizes have been developed for it; consequently, the screen format varies according to font size. While the Monochrome Display does not display exactly 72 increments per inch, the font sizes are close approximations to those of typographic fonts. Figure 2 shows the screen format for the Monochrome Display and Figure 3 that of the Text Terminal. 1 ................. 30 .......................................... 128 +------------------------------------------------------~-----//----+ 1 <adv/cmd> I] <advisory> : [<command input area> I 2 <hdr/sel> I] <fname> @ <tline> I <sfname> <stline .. > <sbline> I 3 <text1> I [ I 4 <text2> I I 5 <text3> I I 49 <text47> I I 50 <cmd> IS1:Select S2:Clear S3:Copy S4:Move S5:Break S6:Fill S7:XeqCmd S8:Exit +---------------------------------~--------------------------//----+ Figure 2. Monochrome Display Screen Format 9051A -3- Text Editing REDIT 1 ................. 30 ................................. ; ........ 80 +------------------------------------------------------------//----+ 1 <adv/cmd> I]<advisory> : [<command input area> I 2 <hdr/se1> I]<fname> @ <t1ine> I <sfname> <st1ine .. > <sb1ine> I 3 <text1> I [ I 4 <text2> I I 5 <text3> I I 24 <text22> I I 25 <cmd> 11:Prev 2~Next 3:Se1 4:Copy 5:Brk 6:Fi11 7:Undo 8:A 9:B 10:C 11:Cmdl +------------------------------------------------------------//----+ Figure 3. Text Terminal Screen Format In these illustrations, the following notation is used: ] Denotes the beginning of an area into which the user cannot enter text (a protected area). [ Denotes the beginning of an area into which the user can enter text (an unprotected area). <adv/cmd> Advisory /command area. <advisory> is where error messages are displayed; <command input area> is where editor commands can be entered. <hdr/sel> Window header and selection status area. The window header con sists of three parts: <fname> The name of the file visible in the window. @ The currency indicator which is displayed if the window is current. <tline> The line number of the line at the top of the window. indent The selection status area displays the state of the currently selected block of text (see the SELECT command). The selection status area consists of three parts: . <sfname> The name of the file containing the currently selected block. <stline> The line number of the top line of the currently selected block. (On the Monochrome Display, <stline> is used to indicate both the top and bottom lines of a selected block for sizes 16 and above because the screen isn't wide enough to accommodate the <sbline> field for these larger fonts.) <sbline> The line number of the bottom line of the currently selected block. <textl .. n> Area of the screen in which text is displayed. The cursor may be placed anywhere within this block for editing; entering text over exist ing text automatically replaces that text.