Commit | Line | Data |
---|---|---|
1cd0e254 C |
1 | /* $Header: help.c,v 4.3.1.2 85/09/10 11:05:39 lwall Exp $ |
2 | * | |
3 | * $Log: help.c,v $ | |
4 | * Revision 4.3.1.2 85/09/10 11:05:39 lwall | |
5 | * Improved %m in in_char(). | |
6 | * | |
7 | * Revision 4.3.1.1 85/05/10 11:33:10 lwall | |
8 | * Branch for patches. | |
9 | * | |
10 | * Revision 4.3 85/05/01 11:38:59 lwall | |
11 | * Baseline for release with 4.3bsd. | |
12 | * | |
13 | */ | |
14 | ||
15 | #include "EXTERN.h" | |
16 | #include "common.h" | |
17 | #include "rn.h" | |
18 | #include "term.h" | |
19 | #include "INTERN.h" | |
20 | #include "help.h" | |
21 | ||
22 | void | |
23 | help_init() | |
24 | { | |
25 | ; | |
26 | } | |
27 | ||
28 | int | |
29 | help_page() | |
30 | { | |
31 | int cmd; | |
32 | ||
33 | #ifdef PAGERHELP | |
34 | doshell(sh,filexp(PAGERHELP)); | |
35 | #else | |
36 | page_init(); | |
37 | if ((cmd = print_lines("\ | |
38 | Paging commands:\n\ | |
39 | ",STANDOUT)) || | |
40 | (cmd = print_lines("\n\ | |
41 | SP Display the next page.\n\ | |
42 | x Display the next page decrypted (rot13).\n\ | |
43 | d Display half a page more.\n\ | |
44 | CR Display one more line.\n\ | |
45 | ^R,v,^X Restart the current article (v=verbose header, ^X=rot13).\n\ | |
46 | ",NOMARKING)) || | |
47 | (cmd = print_lines("\ | |
48 | ^B Back up one page.\n\ | |
49 | ^L,X Refresh the screen (X=rot13).\n\ | |
50 | g pat Go to (search forward within article for) pattern.\n\ | |
51 | G Search again for current pattern within article.\n\ | |
52 | ^G Search for next line beginning with \"Subject:\".\n\ | |
53 | TAB Search for next line beginning with a different character.\n\ | |
54 | q Quit the pager, go to end of article. Leave article read or unread.\n\ | |
55 | j Junk this article (mark it read). Goes to end of article.\n\ | |
56 | \n\ | |
57 | ",NOMARKING)) || | |
58 | (cmd = print_lines("\ | |
59 | The following commands skip the rest of the current article, then behave\n\ | |
60 | just as if typed to the 'What next?' prompt at the end of the article:\n\ | |
61 | ",STANDOUT)) || | |
62 | (cmd = print_lines("\n\ | |
63 | n Scan forward for next unread article.\n\ | |
64 | N Go to next article.\n\ | |
65 | ^N Scan forward for next unread article with same title.\n\ | |
66 | p,P,^P Same as n,N,^N, only going backwards.\n\ | |
67 | - Go to previously displayed article.\n\ | |
68 | \n\ | |
69 | ",NOMARKING)) || | |
70 | (cmd = print_lines("\ | |
71 | The following commands also take you to the end of the article.\n\ | |
72 | Type h at end of article for a description of these commands:\n\ | |
73 | ",STANDOUT)) || | |
74 | (cmd = print_lines("\ | |
75 | # $ & / = ? c C f F k K ^K m M number r R ^R s S u v w W Y ^ |\n\ | |
76 | \n\ | |
77 | (To return to the middle of the article after one of these commands, type ^L.)\n\ | |
78 | ",NOMARKING)) ) | |
79 | return cmd; | |
80 | #endif | |
81 | return 0; | |
82 | } | |
83 | ||
84 | int | |
85 | help_art() | |
86 | { | |
87 | int cmd; | |
88 | #ifdef ARTHELP | |
89 | doshell(sh,filexp(ARTHELP)); | |
90 | #else | |
91 | page_init(); | |
92 | if ((cmd = print_lines("\ | |
93 | Article Selection commands:\n\ | |
94 | ",STANDOUT)) || | |
95 | (cmd = print_lines("\n\ | |
96 | n,SP Scan forward for next unread article.\n\ | |
97 | N Go to next article.\n\ | |
98 | ^N Scan forward for next unread article with same subject.\n\ | |
99 | p,P,^P Same as n,N,^N, only going backwards.\n\ | |
100 | - Go to previously displayed article.\n\ | |
101 | ",NOMARKING)) || | |
102 | (cmd = print_lines("\ | |
103 | number Go to specified article.\n\ | |
104 | range{,range} command{:command}\n\ | |
105 | Apply one or more commands to one or more ranges of articles.\n\ | |
106 | Ranges are of the form: number | number-number. You may use . for\n\ | |
107 | the current article, and $ for the last article.\n\ | |
108 | Valid commands are: j, m, M, s, S, and !.\n\ | |
109 | ",NOMARKING)) || | |
110 | (cmd = print_lines("\ | |
111 | /pattern/modifiers\n\ | |
112 | Scan forward for article containing pattern in the subject line.\n\ | |
113 | (Use ?pat? to scan backwards; append h to scan headers, a to scan\n\ | |
114 | entire articles, r to scan read articles, c to make case sensitive.\n\ | |
115 | /pattern/modifiers:command{:command}\n\ | |
116 | Apply one or more commands to the set of articles matching pattern.\n\ | |
117 | Use a K modifier to save entire command to the KILL file for this\n\ | |
118 | newsgroup. Commands m and M, if first, imply an r modifier.\n\ | |
119 | Valid commands are: j, m, M, s, S, and !.\n\ | |
120 | ",NOMARKING)) || | |
121 | (cmd = print_lines("\ | |
122 | f,F Submit a followup article (F = include this article).\n\ | |
123 | r,R Reply through net mail (R = include this article).\n\ | |
124 | s ... Save to file or pipe via sh.\n\ | |
125 | S ... Save via preferred shell.\n\ | |
126 | w,W Like s and S but save without the header.\n\ | |
127 | | ... Same as s|...\n\ | |
128 | C Cancel this article, if yours.\n\ | |
129 | ",NOMARKING)) || | |
130 | (cmd = print_lines("\ | |
131 | ^R,v Restart article (v=verbose).\n\ | |
132 | ^X Restart article, rot13 mode.\n\ | |
133 | c Catch up (mark all articles as read).\n\ | |
134 | ^B Back up one page.\n\ | |
135 | ^L Refresh the screen. You can get back to the pager with this.\n\ | |
136 | X Refresh screen in rot13 mode.\n\ | |
137 | ",NOMARKING)) || | |
138 | (cmd = print_lines("\ | |
139 | ^ Go to first unread article. Disables subject search mode.\n\ | |
140 | $ Go to end of newsgroup. Disables subject search mode.\n\ | |
141 | ",NOMARKING)) || | |
142 | (cmd = print_lines("# Print last article number.\n\ | |
143 | & Print current values of command-line switches.\n\ | |
144 | &switch {switch}\n\ | |
145 | Set or unset more switches.\n\ | |
146 | && Print current macro definitions.\n\ | |
147 | &&def Define a new macro.\n\ | |
148 | j Junk this article (mark it read). Stays at end of article.\n\ | |
149 | m Mark article as still unread.\n\ | |
150 | M Mark article as still unread upon exiting newsgroup or Y command.\n\ | |
151 | ",NOMARKING)) || | |
152 | (cmd = print_lines("\ | |
153 | Y Yank back articles marked temporarily read via M.\n\ | |
154 | k Mark current SUBJECT as read.\n\ | |
155 | K Mark current SUBJECT as read, and save command in KILL file.\n\ | |
156 | = List subjects of unread articles.\n\ | |
157 | u Unsubscribe to this newsgroup.\n\ | |
158 | ^K Edit local KILL file (the one for this newsgroup).\n\ | |
159 | q Quit this newsgroup for now.\n\ | |
160 | Q Quit newsgroup, staying at current newsgroup.\n\ | |
161 | ",NOMARKING)) ) | |
162 | return cmd; | |
163 | #endif | |
164 | return 0; | |
165 | } | |
166 | ||
167 | int | |
168 | help_ng() | |
169 | { | |
170 | int cmd; | |
171 | #ifdef NGHELP | |
172 | doshell(sh,filexp(NGHELP)); | |
173 | #else | |
174 | page_init(); | |
175 | if (cmd = print_lines("\ | |
176 | Newsgroup Selection commands:\n\ | |
177 | ",STANDOUT) ) | |
178 | return cmd; | |
179 | if (ng != nextrcline) { | |
180 | if (cmd = print_lines("\ | |
181 | \n\ | |
182 | y,SP Do this newsgroup now.\n\ | |
183 | .cmd Do this newsgroup, executing cmd as first command.\n\ | |
184 | = Equivalent to .=<carriage return>.\n\ | |
185 | u Unsubscribe from this newsgroup.\n\ | |
186 | c Catch up (mark this newsgroup all read).\n\ | |
187 | ",NOMARKING) ) | |
188 | return cmd; | |
189 | } | |
190 | if ((cmd = print_lines("\ | |
191 | \n\ | |
192 | n Go to the next newsgroup with unread news.\n\ | |
193 | N Go to the next newsgroup.\n\ | |
194 | p Go to the previous newsgroup with unread news.\n\ | |
195 | P Go to the previous newsgroup.\n\ | |
196 | ",NOMARKING)) || | |
197 | (cmd = print_lines("\ | |
198 | - Go to the previously displayed newsgroup.\n\ | |
199 | 1 Go to the first newsgroup.\n\ | |
200 | ^ Go to the first newsgroup with unread news.\n\ | |
201 | $ Go to the last newsgroup.\n\ | |
202 | ",NOMARKING)) || | |
203 | (cmd = print_lines("\ | |
204 | g name Go to the named newsgroup. Subscribe to new newsgroups this way too.\n\ | |
205 | /pat Search forward for newsgroup matching pattern.\n\ | |
206 | ?pat Search backward for newsgroup matching pattern.\n\ | |
207 | (Use * and ? style patterns. Append r to include read newsgroups.)\n\ | |
208 | ",NOMARKING)) || | |
209 | (cmd = print_lines("\ | |
210 | l pat List unsubscribed newsgroups containing pattern.\n\ | |
211 | m name Move named newsgroup elsewhere (no name moves current newsgroup).\n\ | |
212 | o pat Only display newsgroups matching pattern. Omit pat to unrestrict.\n\ | |
213 | a pat Like o, but also scans for unsubscribed newsgroups matching pattern.\n\ | |
214 | L List current .newsrc.\n\ | |
215 | ",NOMARKING)) || | |
216 | (cmd = print_lines("\ | |
217 | & Print current command-line switch settings.\n\ | |
218 | &switch {switch}\n\ | |
219 | Set (or unset) more command-line switches.\n\ | |
220 | && Print current macro definitions.\n\ | |
221 | &&def Define a new macro.\n\ | |
222 | !cmd Shell escape.\n\ | |
223 | ",NOMARKING)) || | |
224 | (cmd = print_lines("\ | |
225 | q Quit rn.\n\ | |
226 | ^K Edit the global KILL file. Use commands like /pattern/j to suppress\n\ | |
227 | pattern in every newsgroup.\n\ | |
228 | v Print version.\n\ | |
229 | ",NOMARKING)) ) | |
230 | return cmd; | |
231 | #endif | |
232 | #ifdef PUSHBACK | |
233 | if (cmd = get_anything()) | |
234 | return cmd; | |
235 | show_macros(); | |
236 | #endif | |
237 | return 0; | |
238 | } | |
239 | ||
240 | #ifdef ESCSUBS | |
241 | int | |
242 | help_subs() | |
243 | { | |
244 | int cmd; | |
245 | #ifdef SUBSHELP | |
246 | doshell(sh,filexp(SUBSHELP)); | |
247 | #else | |
248 | page_init(); | |
249 | if ((cmd = print_lines("\ | |
250 | Valid substitutions are:\n\ | |
251 | ",STANDOUT)) || | |
252 | (cmd = print_lines("\ | |
253 | \n\ | |
254 | a Current article number\n\ | |
255 | A Full name of current article (%P/%c/%a)\n\ | |
256 | b Destination of last save command, often a mailbox\n\ | |
257 | B Bytes to ignore at beginning of last saved article\n\ | |
258 | ",NOMARKING)) || | |
259 | (cmd = print_lines("\ | |
260 | c Current newsgroup, directory form\n\ | |
261 | C Current newsgroup, dot form\n\ | |
262 | d Full name of newsgroup directory (%P/%c)\n\ | |
263 | D Distribution line from current article\ | |
264 | ",NOMARKING)) || | |
265 | (cmd = print_lines("\ | |
266 | f Who the current article is from\n\ | |
267 | F Newsgroups to followup to (from Newsgroups and Followup-To)\n\ | |
268 | h (This help message)\n\ | |
269 | H Host name (yours)\n\ | |
270 | i Message-I.D. line from current article, with <>\n\ | |
271 | I Reference indicator mark (see -F switch)\n\ | |
272 | ",NOMARKING)) || | |
273 | (cmd = print_lines("\ | |
274 | l News administrator's login name, if any\n\ | |
275 | L Login name (yours)\n\ | |
276 | m Current mode, first letter of (init, newsgroup, article, pager,\n\ | |
277 | Add, Catchup, Delete bogus, Mailbox, Resubscribe)\n\ | |
278 | M Number of article marked with M\n\ | |
279 | n Newsgroups from current article\n\ | |
280 | N Full name (yours)\n\ | |
281 | ",NOMARKING)) || | |
282 | (cmd = print_lines("\ | |
283 | o Organization (yours)\n\ | |
284 | O Original working directory (where you ran rn from)\n\ | |
285 | p Your private news directory (from -d)\n\ | |
286 | P Public news spool directory\n\ | |
287 | ",NOMARKING)) || | |
288 | (cmd = print_lines("\ | |
289 | r Last reference (parent article id)\n\ | |
290 | R References list for followup article\n\ | |
291 | s Subject, with all Re's and (nf)'s stripped off\n\ | |
292 | S Subject, with one Re stripped off\ | |
293 | ",NOMARKING)) || | |
294 | (cmd = print_lines("\ | |
295 | t New To line derived from From and Reply-To (Internet format)\n\ | |
296 | T New To line derived from Path\n\ | |
297 | u Number of unread articles\n\ | |
298 | U Number of unread articles not counting current article\n\ | |
299 | x News library directory\n\ | |
300 | X Rn library directory\n\ | |
301 | z Length of current article in bytes\n\ | |
302 | ",NOMARKING)) || | |
303 | (cmd = print_lines("\ | |
304 | ~ Your home directory\n\ | |
305 | . Directory containing . files\n\ | |
306 | $ Current process number\n\ | |
307 | / Last search string\n\ | |
308 | ESC Run preceding command through % interpretation\n\ | |
309 | ",NOMARKING)) ) | |
310 | return cmd; | |
311 | #endif | |
312 | return 0; | |
313 | } | |
314 | #endif | |
315 |