1 06/16/81  APL context editing
 2 
 3 The MR9.0 release of APL offers some new requests which provide a
 4 context editing capability.  These requests allow searching for a
 5 specified string in a function, substitution of one string for
 6 another, and selection of all lines in a function containing a
 7 specified string.
 8 
 9 
10 Notes on Syntax:
11 The context editing commands are provided as an extension to the
12 regular APL editor.  Request lines beginning with a dot are
13 interpreted as context editing commands.  A slash is used as the
14 string delimiter.  The slash character may not appear inside a
15 search or substitution string.  No other editor requests may
16 follow a context request on the same line.
17 
18 
19 Context searching:
20 
21 ./string/
22 
23 Searches for the first line in the function containing "string".
24 The search begins at the current line and proceeds to the end of
25 the function, then continues from the top of the function to the
26 original line.  The line which contains "string" is displayed.
27 If an empty search string is specified (//), the previous search
28 string is used.  The slash character may not appear in the search
29 string.
30 
31 
32 Reverse searching:
33 
34 .</string/
35 
36 Searches backwards (toward the beginning of the function) for
37 "string".  The search begins on the current line of the function
38 and proceeds to the beginning of the function, then continues
39 from the bottom of the function to the original line.  The line
40 which contains "string" is displayed.  If an empty search string
41 is specified (//), the previous search string is used.  The slash
42 character may not appear in the search string.
43 
44 
45 Substitution:
46 
47 .s/string1/string2/
48 
49 Substitutes "string2" for the first occurance of "string1" in the
50 current line.  The line is displayed after the substitution is
51 made.  If string1 is empty, the previous search string or
52 substitute string1 is used.  If string2 is empty, string1 is
53 deleted from the line.  The slash character may not appear in
54 either substitute string.
55 
56 .s/string1/string2/p
57 
58 If a "p" is typed at the end of a substitute request, the line is
59 displayed after the change has been made.
60 
61 
62 .s/string1/string2/?
63 
64 If a "?" is typed at the end of a substitute request, the line is
65 displayed with the substitution made, and the user is asked if
66 the substitution is correct.  The change is actually made only if the
67 user answers "yes".
68 
69 
70 Global line selection:
71 
72 .g/string/
73 
74 Finds  and  display all lines in the function containing "string".
75 The slash character may not appear in the string.  The current
76 line is not changed.