1 /* help.c
2  */
3 /* This software is copyrighted as detailed in the LICENSE file. */
4 
5 
6 #include "EXTERN.h"
7 #include "common.h"
8 #include "list.h"
9 #include "ngdata.h"
10 #include "term.h"
11 #include "INTERN.h"
12 #include "help.h"
13 
14 void
help_init()15 help_init()
16 {
17     ;
18 }
19 
20 int
help_page()21 help_page()
22 {
23     int cmd;
24 #ifdef PAGERHELP
25     doshell(sh,filexp(PAGERHELP));
26 #else
27     page_start();
28     if ((cmd = print_lines("\
29 Paging commands:\n\
30 ",STANDOUT)) ||
31     (cmd = print_lines("\n\
32 SP	Display the next page.\n\
33 x	Change the current article filter (between ROT-13 and WWW viewer).\n\
34 d	Display half a page more.\n\
35 CR	Display one more line.\n\
36 ^R,v,^X	Restart the current article (v=verbose header, ^X=current filter).\n\
37 ",NOMARKING)) ||
38     (cmd = print_lines("\
39 b	Back up one page.\n\
40 ^E	Display the last page of the article.\n\
41 ^L,X	Refresh the screen (X=rot13).\n\
42 _C      Switch characterset conversion.\n\
43 ",NOMARKING)) ||
44     (cmd = print_lines("\
45 t	Display the entire article tree and all its subjects.\n\
46 ",NOMARKING)) ||
47     (cmd = print_lines("\
48 g pat	Go to (search forward within article for) pattern.\n\
49 G	Search again for current pattern within article.\n\
50 ^G	Search for next line beginning with \"Subject:\".\n\
51 TAB	Search for next line beginning with a different character.\n\
52 q	Quit the pager, go to end of article.  Leave article read or unread.\n\
53 j	Junk this article (mark it read).  Goes to end of article.\n\
54 h, ?	Enter online help browser.\n\
55 H	This help.\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 ",NOMARKING)) ||
69     (cmd = print_lines("\
70 <, >	Browse the previous/next selected thread.  If no threads are selected,\n\
71 	all threads that had unread news upon entry to the group are considered\n\
72 	selected for browsing.  Entering an empty group browses all threads.\n\
73 [, ]	Go to article's parent/child (try left-/right-arrow also).\n\
74 (, )	Go to article's previous/next sibling (try up-/down-arrow also).\n\
75 {, }	Go to tree's root/leaf.\n\
76 \n\
77 ",NOMARKING)) ||
78 #ifdef SCAN
79     (cmd = print_lines("\
80 ;	Enter article-scan mode.\n\
81 ",NOMARKING)) ||
82 #endif
83 #ifdef SCORE
84     (cmd = print_lines("\
85 Scoring commands are enabled.\n\
86 (Type h at end of article for description of Scoring commands.)\n\
87 ",NOMARKING)) ||
88 #endif
89     (cmd = print_lines("\
90 The following commands also take you to the end of the article.\n\
91 Type h at end of article for a description of these commands:\n\
92 ",STANDOUT)) ||
93     (cmd = print_lines("\
94 	# $ & / = ? c C f F k K ^K J , m M number e r R ^R s S u U v w W Y ^ |\n\
95 \n\
96 (To return to the middle of the article after one of these commands, type ^L.)\n\
97 ",NOMARKING)) )
98 	return cmd;
99 #endif
100     return 0;
101 }
102 
103 int
help_art()104 help_art()
105 {
106     int cmd;
107 #ifdef ARTHELP
108     doshell(sh,filexp(ARTHELP));
109 #else
110     page_start();
111     if ((cmd = print_lines("\
112 Article Selection commands:\n\
113 ",STANDOUT)) ||
114     (cmd = print_lines("\n\
115 n,SP	Find next unread article (follows discussion-tree in threaded groups).\n\
116 ",NOMARKING)) ||
117     (cmd = print_lines("\
118 N	Go to next article.\n\
119 ^N	Scan forward for next unread article with same subject in date order.\n\
120 p,P,^P	Same as n,N,^N, only going backwards.\n\
121 _N,_P	Go to the next/previous article numerically.\n\
122 -	Go to previously displayed article.\n\
123 ",NOMARKING)) ||
124     (cmd = print_lines("\
125 <, >	Browse the previous/next selected thread.  If no threads are selected,\n\
126 	all threads that had unread news upon entry to the group are considered\n\
127 	selected for browsing.  Entering an empty group browses all threads.\n\
128 [, ]	Go to article's parent/child (try left-/right-arrow also).\n\
129 (, )	Go to article's previous/next sibling (try up-/down-arrow also).\n\
130 {, }	Go to tree's root/leaf.\n\
131 t	Display the entire article tree and all its subjects.\n\
132 ",NOMARKING)) ||
133     (cmd = print_lines("\
134 number	Go to specified article.\n\
135 range{,range}:command{:command}\n\
136 	Apply one or more commands to one or more ranges of articles.\n\
137 	Ranges are of the form: number | number-number.  You may use . for\n\
138 	the current article, and $ for the last article.\n\
139 ",NOMARKING)) ||
140     (cmd = print_lines("\
141  	Valid commands are: a, e, j, m, M, s, S, t, T, |, +, ++, -, and --.\n\
142 :cmd	Perform a command on all the selected articles.\n\
143 ::cmd	Perform a command on all non-selected articles.\n\
144 :.cmd	Perform a command on the current thread or its selected articles.\n\
145 ::.cmd	Perform a command on the unselected articles in the current thread.\n\
146 ",NOMARKING)) ||
147     (cmd = print_lines("\
148 /pattern/modifiers\n\
149 	Scan forward for article containing pattern in the subject line.\n\
150 	(Use ?pat? to scan backwards; append f to scan from lines, h to scan\n\
151 	whole headers, a to scan entire articles, r to scan read articles, c\n\
152 	to make case-sensitive, t to scan from the top of the group.)\n\
153 ",NOMARKING)) ||
154     (cmd = print_lines("\
155 /pattern/modifiers:command{:command}\n\
156 	Apply one or more commands to the set of articles matching pattern.\n\
157 	Use a K modifier to save entire command to the KILL file for this\n\
158 	newsgroup.  If the m command is first, it implies an r modifier.\n\
159  	Valid commands are the same as for the range command.\n\
160 ",NOMARKING)) ||
161     (cmd = print_lines("\
162 f,F	Submit a followup article (F = include this article).\n\
163 r,R	Reply through net mail (R = include this article).\n\
164 ^F	Forward article through net mail.\n\
165 e dir{|command}\n\
166 	Extract a mime, uue, or shar file to \"dir\" (using command).\n\
167 s ...	Save to file or pipe via sh.\n\
168 S ...	Save via preferred shell.\n\
169 w,W	Like s and S but save without the header.\n\
170 | ...	Same as s|...\n\
171 a	View article attachments.\n\
172 ",NOMARKING)) ||
173     (cmd = print_lines("\
174 C	Cancel this article, if yours.\n\
175 ^R,v	Restart article (v=verbose).\n\
176 x	Change the current article filter (between ROT-13 and WWW viewer).\n\
177 ^X	View article using current filter (ROT-13 (default) or WWW viewer).\n\
178 _C      Switch characterset conversion.\n\
179 c	Catch up (mark all articles as read).\n\
180 b	Back up one page.\n\
181 ",NOMARKING)) ||
182     (cmd = print_lines("\
183 ^E	Display the last page of the article.\n\
184 ^L	Refresh the screen.  You can get back to the pager with this.\n\
185 X	Refresh screen in rot13 mode.\n\
186 ^	Go to first unread article.  Disables subject search mode.\n\
187 $	Go to end of newsgroup.  Disables subject search mode.\n\
188 ",NOMARKING)) ||
189     (cmd = print_lines("#       Print last article number.\n\
190 &	Start the option selector.\n\
191 &switch {switch}\n\
192 	Set or unset more switches.\n\
193 &&	Print current macro definitions.\n\
194 &&def	Define a new macro.\n\
195 j	Junk this article (mark it read).  Stays at end of article.\n\
196 ",NOMARKING)) ||
197     (cmd = print_lines("\
198 m	Mark article as still unread.\n\
199 M	Mark article as read but to-return on group exit or Y command.\n\
200 Y	Yank back articles marked as to-return via the M command.\n\
201 k	Kill current subject (mark articles as read).\n\
202 ,	Mark current article and its replies as read.\n\
203 ",NOMARKING)) ||
204     (cmd = print_lines("\
205 J	Junk entire thread (mark all subjects as read in this thread).\n\
206 A	Add current subject to memorized commands (selection or killing).\n\
207 T	Add current (sub)thread to memorized commands (selection or killing).\n\
208 K	Mark current subject as read, and save command in KILL file.\n\
209 ^K	Edit local KILL file (the one for this newsgroup).\n\
210 ",NOMARKING)) ||
211     (cmd = print_lines("\
212 =	List subjects of unread articles.\n\
213 +	Start the selector in whatever mode it was last in.\n\
214 _a	Start the article selector.\n\
215 _s	Start the subject selector.\n\
216 _t	Start the thread selector.\n\
217 ",NOMARKING)) ||
218 #ifdef SCAN
219     (cmd = print_lines("\
220 ;	Enter article-scan mode.\n\
221 ",NOMARKING)) ||
222 #endif
223     (cmd = print_lines("\
224 _T	Start the thread selector if threaded, else the subject selector.\n\
225 U	Unread some news -- prompts for thread, subthread, all, or select.\n\
226 u	Unsubscribe from this newsgroup.\n\
227 q	Quit this newsgroup for now.\n\
228 Q	Quit newsgroup, staying at current newsgroup.\n\
229 ",NOMARKING))
230 #ifdef SCORE
231     || (cmd = print_lines("\
232 Scoring commands:\n\
233 ",STANDOUT)) ||
234     (cmd = print_lines("\
235 \"\" <text>\n\
236 	Adds <text> to the local (this newsgroup's) scorefile.\n\
237 \"* <text>\n\
238 	Adds <text> to the global scorefile.\n\
239 \"C <text>\n\
240 	Adds <text> to the scorefile represented by the abbreviation C.\n\
241 \"?	List all scorefile abbreviations and the filenames they represent.\n\
242 \"! <text>\n\
243 	Adds <text> to the internal list of scoring rules as if it was read\n\
244 	from a file.  Articles are rescored after this command.\n\
245 'd	Debugging dump.  (Will go away in later versions.)\n\
246 'e <abbreviation OR filename>\n\
247 	Edits the scorefile named by the following file abbreviation\n\
248 	character or full filename.  If no arguments are given, edits the\n\
249 	local scorefile (the one for the current newsgroup).\n\
250 'f	Continue scoring articles until interrupted.\n\
251 'r	Discard old scoring data and rescore from score files.\n\
252 's	Show scoring rules which contributed to this article's score.\n\
253 't	Test command: may do varying things.  (will usually be disabled)\n\
254 ",NOMARKING))
255 #endif /* SCORE */
256     )
257 	return cmd;
258 #endif
259     return 0;
260 }
261 
262 int
help_ng()263 help_ng()
264 {
265     int cmd;
266 #ifdef NGHELP
267     doshell(sh,filexp(NGHELP));
268 #else
269     page_start();
270     if ((cmd = print_lines("\
271 Newsgroup Selection commands:\n\
272 ",STANDOUT)) != 0)
273 	return cmd;
274     if (ngptr) {
275 	if ((cmd = print_lines("\
276 \n\
277 y	Do this newsgroup now.\n\
278 SP	Do this newsgroup, executing the default command listed in []'s.\n\
279 .cmd	Do this newsgroup, executing cmd as first command.\n\
280 +	Enter this newsgroup through the selector (like typing .+<CR>).\n\
281 =	Start this newsgroup, but list subjects before reading articles.\n\
282 U	Enter this newsgroup by way of the \"Set unread?\" prompt.\n\
283 ",NOMARKING)) ||
284 #ifdef SCAN
285     (cmd = print_lines("\
286 ;	Enter article-scan mode for this newsgroup.\n\
287 ",NOMARKING)) ||
288 #endif
289     (cmd = print_lines("\
290 u	Unsubscribe from this newsgroup.\n\
291 ^N	Switch to next news source (the numbered GROUPs in ~/.trn/access).\n\
292 ^P	Switch to the previous news source.\n\
293 ",NOMARKING)) )
294 	    return cmd;
295     }
296     if ((cmd = print_lines("\
297 t	Toggle the newsgroup between threaded and unthreaded reading.\n\
298 c	Catch up (mark all articles as read).\n\
299 A	Abandon read/unread changes to this newsgroup since you started trn.\n\
300 n	Go to the next newsgroup with unread news.\n\
301 N	Go to the next newsgroup.\n\
302 p	Go to the previous newsgroup with unread news.\n\
303 P	Go to the previous newsgroup.\n\
304 ",NOMARKING)) ||
305     (cmd = print_lines("\
306 -	Go to the previously displayed newsgroup.\n\
307 1	Go to the first newsgroup.\n\
308 ^	Go to the first newsgroup with unread news.\n\
309 $	Go to the end of newsgroups.\n\
310 ",NOMARKING)) ||
311     (cmd = print_lines("\
312 g name	Go to the named newsgroup.  Subscribe to new newsgroups this way too.\n\
313 /pat	Search forward for newsgroup matching pattern.\n\
314 ?pat	Search backward for newsgroup matching pattern.\n\
315 	(Use * and ? style patterns.  Append r to include read newsgroups.)\n\
316 ",NOMARKING)) ||
317     (cmd = print_lines("\
318 l pat	List unsubscribed newsgroups containing pattern.\n\
319 m name	Move named newsgroup elsewhere (no name moves current newsgroup).\n\
320 o pat	Only display newsgroups matching pattern.  Omit pat to unrestrict.\n\
321 O pat	Like o, but skip empty groups.\n\
322 a pat	Like o, but also scans for unsubscribed newsgroups matching pattern.\n\
323 L	List current .newsrc.\n\
324 ",NOMARKING)) ||
325     (cmd = print_lines("\
326 &	Start the option selector.\n\
327 &switch {switch}\n\
328 	Set (or unset) more command-line switches.\n\
329 &&	Print current macro definitions.\n\
330 &&def	Define a new macro.\n\
331 !cmd	Shell escape.\n\
332 ",NOMARKING)) ||
333     (cmd = print_lines("\
334 `	switch to the newsgroup selector.\n\
335 q	Quit trn.\n\
336 x	Quit, restoring .newsrc to its state at startup of trn.\n\
337 ^K	Edit the global KILL file.  Use commands like /pattern/j to suppress\n\
338 	pattern in every newsgroup.\n\
339 v	Print version and the address for reporting bugs.\n\
340 ",NOMARKING)) )
341 	return cmd;
342 #endif
343     if ((cmd = get_anything()) != 0)
344 	return cmd;
345     show_macros();
346     return 0;
347 }
348 
349 int
help_ngsel()350 help_ngsel()
351 {
352     int cmd;
353     page_start();
354     if ((cmd = print_lines("\
355 The Newsgroup Selector:\n\
356 ",STANDOUT)) ||
357     (cmd = print_lines("\n\
358 a-z,0-9	Select/deselect the indicated group by its letter or number.  Many of\n\
359 	the alpha letters are omitted for the following commands.\n\
360 SP	Perform the default command (usually > or Z).\n\
361 CR	Enter newsgroup(s).  Selects the current group if nothing is selected.\n\
362 .	Toggle the current group's selection.\n\
363 ",NOMARKING)) ||
364     (cmd = print_lines("\
365 k, ','	Mark the current group to kill all unread articles.\n\
366 -	Set a range, as in d - f.  Repeats the last marking action.\n\
367 @	Toggle the selection of all visible groups.\n\
368 ",NOMARKING)) ||
369     (cmd = print_lines("\
370 E	Toggle exclusion of non-selected groups from the selection list.\n\
371 n, ]	Move down to the next group (try down-arrow also).\n\
372 p, [	Move up to the previous group (try up-arrow also).\n\
373 <, >	Go to previous/next page (try left-/right-arrow also).\n\
374 ^, $	Go to first/last page.\n\
375 ",NOMARKING)) ||
376     (cmd = print_lines("\
377 O	Set the selector's order.\n\
378 R	Reverse the current sort order.\n\
379 U	Switch between selecting empty/non-empty newsgroups.\n\
380 ",NOMARKING)) ||
381     (cmd = print_lines("\
382 c	Catch up a group, marking the articles as read without chasing xrefs.\n\
383 =	Refresh the article counts in the selector (will re-grab active).\n\
384 ^N	Switch to next news source (the numbered GROUPs in ~/.trn/access).\n\
385 ^P	Switch to the previous news source.\n\
386 ^K	Edit the global KILL file.\n\
387 ",NOMARKING)) ||
388     (cmd = print_lines("\
389 \\	Escape next char as a command. A selector command is tried first,\n\
390 	then a newsgroup-list command (force the latter with another \\).\n\
391 	E.g. \\a will add groups, \\\\h gets you newsgroup-list help.\n\
392 :cmd	Perform a command on all the selected groups.\n\
393 ::cmd	Perform a command on all non-selected groups.\n\
394 :.cmd	Perform a command on the current group.\n\
395 ::.cmd	Perform a command on the all but the current.\n\
396 ",NOMARKING)) ||
397     (cmd = print_lines("\
398 /pattern/modifiers:command{:command}\n\
399 	Apply one or more commands to the set of groups matching pattern.\n\
400 ",NOMARKING)) ||
401     (cmd = print_lines("\
402 &	Start the option selector or set command-line switches.\n\
403 &&	View or set macro definitions.\n\
404 !cmd	Escape to a subshell.\n\
405 H	This help message.\n\
406 h, ?	Enter online help browser.\n\
407 `, ESC	Leave the selector and return to the rn-style group selector.\n\
408 q	Quit trn.\n\
409 Q	Quit the selector and return to the rn-style group selector.\n\
410 ",NOMARKING)) )
411 	return cmd;
412     return 0;
413 }
414 
415 int
help_addsel()416 help_addsel()
417 {
418     int cmd;
419     page_start();
420     if ((cmd = print_lines("\
421 The Add-Newsgroups Selector:\n\
422 ",STANDOUT)) ||
423     (cmd = print_lines("\n\
424 a-z,0-9	Select/deselect the newsgroup by its letter or number.  Many of\n\
425 	the alpha letters are omitted for the following commands.\n\
426 SP	Perform the default command (usually > or Z).\n\
427 Z,CR	Add the selected groups to the end of your newsrc.\n\
428 .	Toggle the current group's selection.\n\
429 ",NOMARKING)) ||
430     (cmd = print_lines("\
431 k, ','	Mark the current group as undesirable for subscribing.\n\
432 -	Set a range, as in d - f.  Repeats the last marking action.\n\
433 @	Toggle the selection of all visible groups.\n\
434 ",NOMARKING)) ||
435     (cmd = print_lines("\
436 E	Toggle exclusion of non-selected groups from the selection list.\n\
437 n, ]	Move down to the next group (try down-arrow also).\n\
438 p, [	Move up to the previous group (try up-arrow also).\n\
439 <, >	Go to previous/next page (try left-/right-arrow also).\n\
440 ^, $	Go to first/last page.\n\
441 ",NOMARKING)) ||
442     (cmd = print_lines("\
443 O	Set the selector's order (NOT WORKING YET).\n\
444 R	Reverse the current sort order (NOT WORKING YET).\n\
445 ",NOMARKING)) ||
446     (cmd = print_lines("\
447 /pattern/modifiers:commands\n\
448 	Scan all newsgroups for a name matching the pattern.\n\
449 ",NOMARKING)) ||
450     (cmd = print_lines("\
451 &	Start the option selector or set command-line switches.\n\
452 &&	View or set macro definitions.\n\
453 !cmd	Escape to a subshell.\n\
454 H	This help message.\n\
455 h, ?	Enter online help browser.\n\
456 q	Quit the selector.\n\
457 ",NOMARKING)) )
458 	return cmd;
459     return 0;
460 }
461 
462 #ifdef ESCSUBS
463 int
help_subs()464 help_subs()
465 {
466     int cmd;
467 #ifdef SUBSHELP
468     doshell(sh,filexp(SUBSHELP));
469 #else
470     page_start();
471     if ((cmd = print_lines("\
472 Valid substitutions are:\n\
473 ",STANDOUT)) ||
474     (cmd = print_lines("\
475 \n\
476 a	Current article number\n\
477 A	Full name of current article (%P/%c/%a)\n\
478 b	Destination of last save command, often a mailbox\n\
479 B	Bytes to ignore at beginning of last saved article\n\
480 ",NOMARKING)) ||
481     (cmd = print_lines("\
482 c	Current newsgroup, directory form\n\
483 C	Current newsgroup, dot form\n\
484 d	Full name of newsgroup directory (%P/%c)\n\
485 D	Distribution line from current article\n\
486 e	The last command executed to extract data from an article\n\
487 E	The last extraction directory\n\
488 ",NOMARKING)) ||
489     (cmd = print_lines("\
490 f	Who the current article is from\n\
491 F	Newsgroups to followup to (from Newsgroups and Followup-To)\n\
492 h	(This help message)\n\
493 H	Host name (yours)\n\
494 i	Message-I.D. line from current article, with <>\n\
495 I	Reference indicator mark (see -F switch)\n\
496 ",NOMARKING)) ||
497     (cmd = print_lines("\
498 l	News administrator's login name, if any\n\
499 L	Login name (yours)\n\
500 ",NOMARKING)) ||
501     (cmd = print_lines("\
502 m	Current mode, first letter of (init,newsgroup,thread,article,pager,\n\
503 		unread,Add,Catchup,Delete-bogus,Mailbox,Resubscribe)\n\
504 ",NOMARKING)) ||
505     (cmd = print_lines("\
506 M	Number of article marked with M\n\
507 n	Newsgroups from current article\n\
508 N	Full name (yours)\n\
509 o	Organization (yours)\n\
510 O	Original working directory (where you ran trn from)\n\
511 ",NOMARKING)) ||
512     (cmd = print_lines("\
513 p	Your private news directory (from -d)\n\
514 P	Public news spool directory\n\
515 r	Last reference (parent article id)\n\
516 R	References list for followup article\n\
517 ",NOMARKING)) ||
518     (cmd = print_lines("\
519 s	Subject, with all Re's and (nf)'s stripped off\n\
520 S	Subject, with one Re stripped off\n\
521 t	New To line derived from From and Reply-To (Internet format)\n\
522 T	New To line derived from Path\n\
523 u	Number of unread articles\n\
524 ",NOMARKING)) ||
525     (cmd = print_lines("\
526 U	Number of unread articles not counting the current article (when\n\
527 	threads are selected, the count only reflects selected articles)\n\
528 v	The number of extra (unselected) articles, not counting the current\n\
529 	one if it is unselected\n\
530 W	Where thread files are saved\n\
531 x	News library directory\n\
532 X	Trn library directory\n\
533 ",NOMARKING)) ||
534 #ifdef SCORE
535     (cmd = print_lines("\
536 y	From line with the domain abbreviated.\n\
537 	(foo@x.y.bar.edu (Foo's Bar) -> foo@*.bar.edu (Foo's Bar))\n\
538 ",NOMARKING)) ||
539 #endif
540     (cmd = print_lines("\
541 Y	The current tmp dir (usually /tmp)\n\
542 z	Length of current article in bytes\n\
543 Z	Number of selected threads\n\
544 ",NOMARKING)) ||
545     (cmd = print_lines("\
546 ~	Your home directory\n\
547 .	Directory containing the \"dot\" files, such as .newsrc\n\
548 +	Your trn config file directory (usually %./.trn)\n\
549 #	A counter in multi-article saves\n\
550 $	Current process number\n\
551 /	Last search string\n\
552 ESC	Run preceding command through % interpretation\n\
553 ",NOMARKING)) ||
554     (cmd = print_lines("\
555 Put ^ in the middle to capitalize the first letter: %^C = Rec.humor\n\
556 Put _ in the middle to capitalize the last component: %_c = rec/Humor\n\
557 Put \\ in the middle to quote regexp and % characters in the resulting string\n\
558 Put :FMT in the middle to format the result printf-style:  %:-30.30t\n\
559 ",NOMARKING)) )
560 	return cmd;
561 #endif
562     return 0;
563 }
564 #endif
565 
566 int
help_artsel()567 help_artsel()
568 {
569     int cmd;
570     page_start();
571     if ((cmd = print_lines("\
572 Thread/Subject/Article Selector Commands:\n\
573 ",STANDOUT)) ||
574     (cmd = print_lines("\n\
575 a-z,0-9	Select/deselect the indicated item by its letter or number.  Many of\n\
576 	the alpha letters are omitted for the following commands.\n\
577 SP	Perform the default command (usually > or Z).\n\
578 CR	Start reading.  Selects the current item if nothing is selected.\n\
579 Z,TAB	Start reading.  If nothing is selected, read all unread articles.\n\
580 .	Toggle the current item's selection.\n\
581 *	Same as '.' except that it affects all items with the same subject.\n\
582 ",NOMARKING)) ||
583 #ifdef SCAN
584     (cmd = print_lines("\
585 ;	Enter article-scan mode.  If articles/subjects/threads were selected\n\
586 	in the trn selector, article-scan will show only those articles.\n\
587 ",NOMARKING)) ||
588 #endif
589     (cmd = print_lines("\
590 #	Read the current item only, temporarily ignoring all other selections.\n\
591 k, ','	Mark the current item as killed.\n\
592 m, |	Unmark the current item.\n\
593 -	Set a range, as in d - f.  Repeats the last marking action.\n\
594 @	Toggle the selection of all visible items.\n\
595 M	Mark the current item's article(s) as to-return and kill the item.\n\
596 Y	Yank back and select articles marked to return via M.\n\
597 ",NOMARKING)) ||
598     (cmd = print_lines("\
599 E	Toggle exclusion of non-selected items from the selection list.\n\
600 n, ]	Move down to the next item (try down-arrow also).\n\
601 p, [	Move up to the previous item (try up-arrow also).\n\
602 <, >	Go to previous/next page (try left-/right-arrow also).\n\
603 ^, $	Go to first/last page.\n\
604 S	Set what the selector displays:  threads, subjects, or articles.\n\
605 	If the group is unthreaded, choosing threads will thread it.\n\
606 ",NOMARKING)) ||
607     (cmd = print_lines("\
608 =	Toggle between the article and thread/subject selector.\n\
609 O	Set the selector's order.  A separate default is kept for the\n\
610 	article and subject/thread selector.\n\
611 R	Reverse the current sort order.\n\
612 L	Switch the display between a short style without authors and a\n\
613 	medium or long style with authors.\n\
614 U	Switch between selecting unread/read articles.\n\
615 X	Mark all unselected articles as read and start reading.\n\
616 ",NOMARKING)) ||
617     (cmd = print_lines("\
618 D	Mark unselected articles on the current page as read.  Start\n\
619 	reading if articles were selected, else go to next page.\n\
620 J	Junk all selected articles (mark them as read).\n\
621 c	Catch up -- marks ALL articles as read without chasing xrefs.\n\
622 A	Add current subject to memorized commands (selection or killing).\n\
623 T	Add current thread to memorized commands (selection or killing).\n\
624 ^K	Edit local KILL file (the one for this newsgroup).\n\
625 N	Leave this group as-is and go on to the next one.\n\
626 ",NOMARKING)) ||
627     (cmd = print_lines("\
628 P	Leave this group as-is and go on to the previous one.\n\
629 :cmd	Perform a command on all the selected articles (use :p to post).\n\
630 ::cmd	Perform a command on all non-selected articles.\n\
631 :.cmd	Perform a command on the current thread or its selected articles.\n\
632 ::.cmd	Perform a command on the unselected articles in the current thread.\n\
633 /pattern/modifiers\n\
634 	Scan all articles for a subject containing pattern.\n\
635 	(Append f to scan the from line, h to scan whole headers, a to scan\n\
636 ",NOMARKING)) ||
637     (cmd = print_lines("\
638 	entire articles, c to make it case-sensitive, r to scan read articles\n\
639 	(assumed when you are selecting read articles to set unread.)\n\
640 /pattern/modifiers:command{:command}\n\
641 	Apply one or more commands to the set of articles matching pattern.\n\
642 	Use a K modifier to save entire command to the KILL file for this\n\
643 	newsgroup.  Commands m and M, if first, imply an r modifier.\n\
644  	Valid commands are: e, E, j, m, M, s, S, t, T, !, =, ',' and the\n\
645 	article/thread (de)selection commands: +/++ (-/--).\n\
646 ",NOMARKING)) ||
647     (cmd = print_lines("\
648 &	Start the option selector or set command-line switches.\n\
649 &&	View or set macro definitions.\n\
650 !cmd	Escape to a subshell.\n\
651 H	This help message.\n\
652 h, ?	Enter online help browser.\n\
653 ESC, +	Leave the selector but stay in the group (at last visited article).\n\
654 q	Quit the selector and the group.\n\
655 Q	Quit group and return to news group selection prompt for this group.\n\
656 ",NOMARKING)) )
657 	return cmd;
658     return 0;
659 }
660 
661 int
help_multirc()662 help_multirc()
663 {
664     int cmd;
665     page_start();
666     if ((cmd = print_lines("\
667 The Newsrc Selector:\n\
668 ",STANDOUT)) ||
669     (cmd = print_lines("\n\
670 a-z,0-9	Select/deselect the indicated item by its letter or number.  Many of\n\
671 	the alpha letters are omitted for the following commands.\n\
672 SP	Perform the default command (usually > or Z).\n\
673 CR	Open the newsrc(s).  Selects the current item if nothing is selected.\n\
674 .	Toggle the current item's selection.\n\
675 ",NOMARKING)) ||
676     (cmd = print_lines("\
677 -	Set a range, as in d - f.  Repeats the last marking action.\n\
678 @	Toggle the selection of all visible items.\n\
679 ",NOMARKING)) ||
680     (cmd = print_lines("\
681 E	Toggle exclusion of non-selected items from the selection list.\n\
682 n, ]	Move down to the next item (try down-arrow also).\n\
683 p, [	Move up to the previous item (try up-arrow also).\n\
684 <, >	Go to previous/next page (try left-/right-arrow also).\n\
685 ^, $	Go to first/last page.\n\
686 ",NOMARKING)) ||
687     (cmd = print_lines("\
688 R	Reverse the current sort order.\n\
689 ",NOMARKING)) ||
690     (cmd = print_lines("\
691 &	Start the option selector or set command-line switches.\n\
692 &&	View or set macro definitions.\n\
693 !cmd	Escape to a subshell.\n\
694 H	This help message.\n\
695 h, ?	Enter online help browser.\n\
696 q	Quit trn.\n\
697 ",NOMARKING)) )
698 	return cmd;
699     return 0;
700 }
701 
702 int
help_options()703 help_options()
704 {
705     int cmd;
706     page_start();
707     if ((cmd = print_lines("\
708 The Option Selector:\n\
709 ",STANDOUT)) ||
710     (cmd = print_lines("\n\
711 a-z,0-9	Select/deselect the indicated item by its letter or number.  Many of\n\
712 	the alpha letters are omitted for the following commands.\n\
713 SP	Perform the default command (usually > or Z).\n\
714 CR	Accept changes.  Changes the current item if nothing is selected.\n\
715 Z,TAB	Accept changes.\n\
716 .	Toggle the current item's selection.\n\
717 ",NOMARKING)) ||
718     (cmd = print_lines("\
719 -	Set a range, as in d - f.  Repeats the last marking action.\n\
720 @	Toggle the selection of all visible items.\n\
721 ",NOMARKING)) ||
722     (cmd = print_lines("\
723 E	Toggle exclusion of non-selected items from the selection list.\n\
724 n, ]	Move down to the next item (try down-arrow also).\n\
725 p, [	Move up to the previous item (try up-arrow also).\n\
726 <, >	Go to previous/next page (try left-/right-arrow also).\n\
727 ^, $	Go to first/last page.\n\
728 ",NOMARKING)) ||
729     (cmd = print_lines("\
730 R	Reverse the current sort order.\n\
731 &	Start the option selector or set command-line switches.\n\
732 &&	View or set macro definitions.\n\
733 ",NOMARKING)) ||
734     (cmd = print_lines("\
735 !cmd	Escape to a subshell.\n\
736 H	This help message.\n\
737 h, ?	Enter online help browser.\n\
738 q	Quit the option selector, abandoning changes.\n\
739 \n\
740 ",NOMARKING)) ||
741     (cmd = print_lines("\
742 	The options are as follows:\n\
743 ",STANDOUT)) ||
744     (cmd = print_lines("\n\
745 Use Universal Selector........ yes/no\n\
746 Universal Selector Order...... natural/points\n\
747 Universal Selector art. follow yes/no\n\
748 Universal Selector Commands... [Last-page-cmd][Other-page-cmd]\n\
749 Use Newsrc Selector........... yes/no\n\
750 Newsrc Selector Commands...... [Last-page-cmd][Other-page-cmd]\n\
751 Use Addgroup Selector......... yes/no\n\
752 Addgroup Selector Commands.... [Last-page-cmd][Other-page-cmd]\n\
753 Use Newsgroup Selector........ yes/no\n\
754 Newsgroup Selector Order...... natural/group/count\n\
755 Newsgroup Selector Commands... [Last-page-cmd][Other-page-cmd]\n\
756 Use News Selector............. yes/no/[# articles]\n\
757 ",NOMARKING)) ||
758     (cmd = print_lines("\
759 News Selector Mode............ threads/subjects/articles\n\
760 News Selector Order........... date/subject/author/groups/count/points\n\
761 News Selector Commands........ [Last-page-cmd][Other-page-cmd]\n\
762 News Selector Display Styles.. [e.g. lms=long/medium/short]\n\
763 Option Selector Commands...... [Last-page-cmd][Other-page-cmd]\n\
764 Use Selector Numbers.......... yes/no\n\
765 Selector Number Auto-Goto..... yes/no\n\
766 Use Threads................... yes/no\n\
767 Cited Text String............. [e.g. '>']\n\
768 Select My Postings............ parent/subthread/no\n\
769 ",NOMARKING)) ||
770     (cmd = print_lines("\
771 Read Breadth First............ yes/no\n\
772 Join Subject Lines............ no/[# chars]\n\
773 Terse Output.................. yes/no\n\
774 Check for New Groups.......... yes/no\n\
775 Initial Group List............ [# groups]\n\
776 Background Threading.......... yes/no\n\
777 Background Spinner............ yes/no\n\
778 Compress Subjects............. yes/no\n\
779 ",NOMARKING)) ||
780     (cmd = print_lines("\
781 Auto Savename................. yes/no\n\
782 Default Savefile Type......... norm/mail/ask\n\
783 Fuzzy Newsgroup Names......... yes/no\n\
784 Auto-Grow Groups.............. yes/no\n\
785 Ignore THRU on Select......... yes/no\n\
786 Auto Arrow Macros............. yes/no\n\
787 Save Dir...................... [directory path]\n\
788 Pager Line-Marking............ standout/underline/no\n\
789 ",NOMARKING)) ||
790     (cmd = print_lines("\
791 Erase Screen.................. yes/no\n\
792 Erase Each Line............... yes/no\n\
793 Muck Up Clear................. yes/no\n\
794 Novice Delays................. yes/no\n\
795 Header Magic.................. [[!]header,...]\n\
796 Header Hiding................. [[!]header,...]\n\
797 Initial Article Lines......... no/[# lines]\n\
798 Article Tree Lines............ no/[# lines]\n\
799 Append Unsubscribed Groups.... yes/no\n\
800 ",NOMARKING)) ||
801     (cmd = print_lines("\
802 Line Num for Goto............. [# line (1-n)]\n\
803 Verify Input.................. yes/no\n\
804 Eat Type-Ahead................ yes/no\n\
805 Charset....................... [e.g. patm]\n\
806 Filter Control Characters..... yes/no\n\
807 Scan Mode Count............... no/[# articles]\n\
808 Old Mthreads Database......... yes/no\n\
809 Checkpoint Newsrc Frequency... [# articles]\n\
810 Active File Refetch Mins...... no/[# mins]\n\
811 ",NOMARKING)) )
812 	return cmd;
813     return 0;
814 }
815 
816 #ifdef SCAN
817 int
help_scanart()818 help_scanart()
819 {
820     int cmd;
821 #ifdef UNDEF
822 /* implement this later? */
823     doshell(sh,filexp(SAHELP));
824 #else
825     page_start();
826     if ((cmd = print_lines("\
827 Article scan commands:\n\
828 ",STANDOUT)) ||
829     (cmd = print_lines("\
830 SP,CR	Display article and enter the Article Level.\n\
831 	Note: Marked articles (see 'm') will be displayed first.\n\
832 r	Read the pointed-to article first, then read marked articles.\n\
833 ",NOMARKING)) ||
834     (cmd = print_lines("\
835 [0-9]	Jump to item number.  Enter a second digit or a command to jump\n\
836 	to the item.\n\
837 n, ]	Move down to the next item (try down-arrow also).\n\
838 p, [	Move up to the previous item (try up-arrow also).\n\
839 ^N	Move down to next article with the  same subject.\n\
840 ^P	Move up to previous article with the same subject.\n\
841 >	Display next page of articles.\n\
842 <	Display previous page of articles.\n\
843 ",NOMARKING)) ||
844     (cmd = print_lines("\
845 t	Move to top of current page.\n\
846 b	Move to bottom of current page.\n\
847 T,^	Move to top of all articles.\n\
848 B,$	Move to bottom of all articles.\n\
849 N	Go to next newsgroup.\n\
850 P	Go to previous newsgroup.\n\
851 ",NOMARKING)) ||
852     (cmd = print_lines("\
853 ^L,^R	Redraw screen.\n\
854 j	Junk the article pointed to.\n\
855 k	Junk all articles (after pointer) with same subject.\n\
856 	(much the same as 'k' at the Article Selection Level.\n\
857 ",NOMARKING)) ||
858     (cmd = print_lines("\
859 m	Mark or unmark article for reading or a later command.\n\
860 M	Toggle mark on following articles with same subject.\n\
861 	(This is the same as typing 'm' on each of them.)\n\
862 X	Junk (mark as read) all unmarked articles.\n\
863 D	Junk unmarked articles on the same page. (similar to 'X')\n\
864 	['X' and 'D' act like the TRN thread selector options.]\n\
865 J	Junk marked articles on page.  (opposite of 'D')\n\
866 G	Goto an article by number.\n\
867 e	Extract marked articles (in mime, shar, or uuencoded format) to a\n\
868 	directory.  Multipart files may be extracted in any order.\n\
869 E	End/Examine the last extracted file.  A command can be entered to\n\
870 	examine/view/play the extracted file.  If the file was incomplete,\n\
871 	it can be removed.\n\
872 	[The e and E commands are disabled at the moment.]\n\
873 ",NOMARKING)) ||
874     (cmd = print_lines("\
875 s	Select (for zoom) this article.\n\
876 S	Select (for zoom) all following articles with same subject.\n\
877 z	Enter/exit \"zoom\" mode--only selected articles are displayed.\n\
878 	(Zoom mode is automatically entered when article-scan mode is\n\
879 	entered from the TRN thread selector.)\n\
880 Z	Clear (Zero) the zoom selections\n\
881 	[Note: when in zoom mode commands which delete articles will\n\
882 	only delete selected articles.  This means, for instance, that\n\
883 	'X' will only delete *selected* unmarked articles.  (Useful for\n\
884 	reading only a few articles from a thread.)]\n\
885 ",NOMARKING)) ||
886     (cmd = print_lines("\
887 +	Enter thread selection mode (only if group is threaded).\n\
888 ",NOMARKING)) ||
889     (cmd = print_lines("\
890 !cmd	Escape to a subshell and execute cmd.\n\
891 &	Print current values of command-line switches.\n\
892 &switch {switch}\n\
893 	Set or unset more switches.\n\
894 &&	Print current macro definitions.\n\
895 &&def	Define a new macro.\n\
896 h	Print this help.\n\
897 H	Enter help scan mode (an online documentation browser).\n\
898 q	Quit reading this newsgroup and go to the next one.\n\
899 Q	Leave article scan mode and begin reading articles, starting\n\
900 	with the article pointed to.  You will not return to\n\
901 	article-scan mode unless you type ';' again.\n\
902 c	Catch up on all articles in the current newsgroup.\n\
903 	(All articles are marked as read.)\n\
904 ",NOMARKING)) ||
905     (cmd = print_lines("\
906 /text	Search article descriptions forwards for text.\n\
907 ?text	Search article descriptions backwards for text.\n\
908 gtext   Search article descriptions forwards for text.  If no matching\n\
909 	descriptions are found, continue the search from the first\n\
910 	article description.  (wrap-around search)\n\
911 	Searches are for case-insensitive substring of article\n\
912 	descriptions matching text.  Leading spaces in text are ignored\n\
913 	(which means you can type \"g John Smith\" or \"gJohn Smith\")\n\
914 ",NOMARKING)) ||
915     (cmd = print_lines("\
916 f	Toggle subject following mode.  When enabled article threads\n\
917 	will be followed normally.  When disabled typing space or\n\
918 	return at end of article will return to article-scan mode.\n\
919 	Typing a command explicitly (like ^n) will still work.\n\
920 	(If an explicit command is typed, follow mode will be temporarily\n\
921 	turned on for the remainder of the thread.)\n\
922 F	Toggle subject Folding mode.  (show only first article with a\n\
923 	subject.  Note that \"first\" depends on ordering...)\n\
924 ",NOMARKING)) ||
925     (cmd = print_lines("\
926 U	Toggle reading eligibility: read / unread+read\n\
927 TAB	Toggle display of \"threadcount\" (# of articles following this one\n\
928 	with the same subject)\n\
929 a	Toggle display of authors.\n\
930 %%	Toggle display of article numbers.\n\
931 ",NOMARKING))
932 #ifdef SCORE
933     || (cmd = print_lines("\
934 Scoring commands:\n\
935 ",STANDOUT)) ||
936     (cmd = print_lines("\
937 K(num)	Kill articles with scores equal to or below a number (num).\n\
938 	Type the threshold and press return.  (no spaces: type K-12)\n\
939 ^E	Edit the score file for the current group.\n\
940 o	Toggle article ordering: arrival or score-sorted.\n\
941 O	Toggle article ordering between older-first and newer-first\n\
942 	when in score-sorted order.  (For two articles with same\n\
943 	score, toggle between the older one first or the newer one first.)\n\
944 R	Rescores all articles.  (same as 'r at article level).\n\
945 ",NOMARKING)) ||
946     (cmd = print_lines("\
947 [Note: type ' or \" then RETURN for menus of scoring commands.]\n\
948 \"\" <text>\n\
949 	Adds <text> to the local (this newsgroup's) scorefile.\n\
950 \"* <text>\n\
951 	Adds <text> to the global scorefile.\n\
952 \"C <text>\n\
953 	Adds <text> to the scorefile represented by the abbreviation C.\n\
954 \"?	List all scorefile abbreviations and the filenames they represent.\n\
955 \"! <text>\n\
956 	Adds <text> to the internal list of scoring rules as if it was read\n\
957 	from a file.  Articles are rescored after this command.\n\
958 'd	Debugging dump.  (Will go away in later versions.)\n\
959 'e <abbreviation OR filename>\n\
960 	Edits the scorefile named by the following file abbreviation\n\
961 	character or full filename.  If no arguments are given, edits the\n\
962 	local scorefile (the one for the current newsgroup).\n\
963 'f	Continue scoring articles until interrupted.\n\
964 'r	Discard old scoring data and rescore from score files.\n\
965 's	Show scoring rules which contributed to this article's score.\n\
966 't	Test command: may do varying things.  (will usually be disabled)\n\
967 ",NOMARKING))
968 #endif /* SCORE */
969     )
970 	return cmd;
971 #endif /* !UNDEF (later the !doshell part) */
972     return 0;
973 }
974 #endif /* SCAN */
975 
976 int
help_univ()977 help_univ()
978 {
979     int cmd;
980     page_start();
981     if ((cmd = print_lines("\
982 The Universal Selector:\n\
983 ",STANDOUT)) ||
984     (cmd = print_lines("\n\
985 a-z,0-9	Select/deselect the indicated item by its letter or number.  Many of\n\
986 	the alpha letters are omitted for the following commands.\n\
987 SP	Perform the default command (usually > or Z).\n\
988 CR	Enter item(s).  Selects the current item if nothing is selected.\n\
989 TAB	Start reading selected items.\n\
990 ",NOMARKING)) ||
991     (cmd = print_lines("\
992 -	Set a range, as in d - f.  Repeats the last marking action.\n\
993 @	Toggle the selection of all visible items.\n\
994 .	Toggle the current item's selection.\n\
995 ",NOMARKING)) ||
996     (cmd = print_lines("\
997 E	Toggle exclusion of non-selected items from the selection list.\n\
998 n, ]	Move down to the next item (try down-arrow also).\n\
999 p, [	Move up to the previous item (try up-arrow also).\n\
1000 <, >	Go to previous/next page (try left-/right-arrow also).\n\
1001 ^, $	Go to first/last page.\n\
1002 ",NOMARKING)) ||
1003     (cmd = print_lines("\
1004 O	Set the selector's order.\n\
1005 R	Reverse the current sort order.\n\
1006 U	Switch between selecting empty/non-empty items.\n\
1007 ",NOMARKING)) ||
1008     (cmd = print_lines("\
1009 ^E	Edit the current universal configuration file.\n\
1010 ",NOMARKING)) ||
1011     (cmd = print_lines("\
1012 &	Start the option selector or set command-line switches.\n\
1013 &&	View or set macro definitions.\n\
1014 !cmd	Escape to a subshell.\n\
1015 H	This help message.\n\
1016 h, ?	Enter online help browser.\n\
1017 q	Quit current level.  At top level, leave trn.\n\
1018 Q	Quit the current level.  At top level, go to the next selector.\n\
1019 ",NOMARKING)) )
1020 	return cmd;
1021     return 0;
1022 }
1023 
1024 int
univ_key_help(where)1025 univ_key_help(where)
1026 int where;
1027 {
1028     switch (where) {
1029       case UHELP_PAGE:
1030 	return help_page();
1031       case UHELP_ART:
1032 	return help_art();
1033       case UHELP_NG:
1034 	return help_ng();
1035       case UHELP_NGSEL:
1036 	return help_ngsel();
1037       case UHELP_ADDSEL:
1038 	return help_addsel();
1039 #ifdef ESCSUBS
1040       case UHELP_SUBS:
1041 	return help_subs();
1042 #endif
1043       case UHELP_ARTSEL:
1044 	return help_artsel();
1045       case UHELP_MULTIRC:
1046 	return help_multirc();
1047       case UHELP_OPTIONS:
1048 	return help_options();
1049 #ifdef SCAN
1050       case UHELP_SCANART:
1051 	return help_scanart();
1052 #endif
1053       case UHELP_UNIV:
1054 	return help_univ();
1055       default:
1056 	return 0;
1057     }
1058 }
1059