• Aucun résultat trouvé

Setting the Right Margin

Dans le document PDP–11 Keypad Editor User’s Guide (Page 25-29)

Writing with KED

3.4 Setting the Right Margin

You can set the right margin for new text (Section 3.4.1) or change the right margin for existing text (Section 3.4.2).

3.4.1 New Text

By default, KED lets you type any number of text lines, up to the limit that KED places on the size of your output file. When you reach the last character space on your screen, KED moves the cursor to the beginning of the next line, displays a continuation symbol (♦), and continues the line. To end the line before that point and begin a new one, you must press RETURN (or insert another line terminator described in Section 3.3).

If you wish, you can specify a maximum line length for the text you are creating.

The operation is equivalent to setting an automatic right margin on a typewriter.

To specify a maximum line length:

1. Press GOLD and COMMAND.

2. In response to the command prompt, type:

SET WRAP [number]

number is the maximum number of characters that your new text lines will contain. You can specify any number from 1 to 256.

If you do not specify a number, KED uses a default of 78 if your screen width is 80 characters or a default of 130 if your screen width is 132 characters (that leaves 2 characters for a nonprinting line terminator).

3. Press ENTER. In other words:

GOLD COMMAND SET WRAP [number] ENTER

As you type in text, KED inserts a nonprinting line terminator after the last complete word it can fit on the current line, and then begins a new line. Exceptions:

• If you type a single word that is longer than the maximum number of characters you specified for the right margin, KED leaves the word in a text line by itself.

• If you press TAB , KED processes it normally, and usually the text line that contains the horizontal-tab character reaches past the specified right margin.

• If you press RETURN, KED begins a new line.

• If you insert a carriage-return character by itself, KED overwrites the beginning of the text line that contains that character.

The SET WRAP command also gives you a convenient way to ensure that the text lines you type stay within the limits of your screen. For example, if your screen width is 80 characters, type:

GOLD COMMAND SET WRAP ENTER

KED sets a maximum line length of 78 characters (the default). When you reach the 78-character limit, KED inserts a line terminator after the last complete word that can fit on the line and then begins a new line.

To set a different maximum line length:

GOLD COMMAND SET WRAP new-number ENTER To cancel the SET WRAP operation:

GOLD COMMAND SET NOWRAP ENTER

3.4.2 Existing Text

To change a right margin for existing text or set a right margin for unformatted text, use the SET WRAP command, the SELECT function, and the FILL function or command.

1. Issue the SET WRAP command to specify the line length.

a. Press GOLD and COMMAND.

b. In response to the command prompt, type:

SET WRAP [number]

numberis the maximum number of characters the line will contain. You can specify any number from 1 to 256. (If you specify 1, word is placed on its own line.)

If you do not specify a number, KED uses a default of 78 if your screen width is 80 characters or a default of 130 if your screen width is 132 characters (that leaves 2 characters for a nonprinting line terminator).

c. Press ENTER.

2. Use the SELECT function to select the lines you want to reformat.

a. Move the cursor (as described in Chapter 4) to the beginning of the first line you want to reformat.

b. Press SELECT.

c. Move the cursor to the end of the last line you want to reformat.

As you move the cursor, KED highlights your selection by reversing the text and background or by underlining your selection. If you make a mistake in selecting lines, press GOLD and RESET.

3. Use the FILL function or command to reformat the lines you selected.

To use the FILL function, press GOLD and FILL. To use the FILL command:

a. Press GOLD and COMMAND.

b. In response to the command prompt, type:

FILL

c. Press ENTER. In other words:

GOLD COMMAND SET WRAP [number] ENTER

Move the cursor to the beginning of the first line.

SELECT

Move the cursor to the end of the last line.

Then:

GOLD FILL

or

GOLD COMMAND FILL ENTER

KED reformats the lines you selected according to the line length you specified.

Specifically, KED:

• Inserts a single space in place of spaces and horizontal tabs.

• Substitutes a single space for carriage-return and line-feed characters, whether alone or combined as new-line terminators.

The fill operation joins paragraphs that are separated by blank lines created by carriage-return/line-feed combinations. To avoid having your paragraphs joined, process each paragraph with a separate FILL function or command or use vertical tabs (Section 3.3.3) or form feeds (Section 3.3.1) to separate your paragraphs.

The fill operation is not affected by the SET NOWRAP command. If you use a FILL function or command after using a SET NOWRAP command to disable a set wrap operation, KED continues to use the line length you specified with the SET WRAP command.

3.5 What Next?

Now that you have learned to use your terminal as a typewriter, to begin and end a work session, and to write any kind of text file, you are ready to explore the full power of KED to perform many useful editing operations.

First, however, you should learn all you need to know about moving the cursor, as described in Chapter 4. That chapter shows you how to move the cursor:

Character by character Word by word

Line by line Section by section Page by page

To the end or beginning of your text file Directly to any point in your text file

Chapter 4

Dans le document PDP–11 Keypad Editor User’s Guide (Page 25-29)