/*  --- University of Sussex POPLOG file -----------------------------------
 *  File:           $usepop/master/C.vms/lib/auto/explain.p
 *  Purpose:        finding and printing help file without ved.
 *  Author:         Aaron Sloman, March 1984 (see revisions)
 *  Documentation:  HELP * EXPLAIN
 *  Related Files:
 */

section;

define global macro explain;
lvars topic topfile c;
vars popnewline = true, poplinewidth = poplinemax;
    rdstringto([; ^termin ^newline]) ->> topic -> topfile;
    false -> popnewline;
    sysfileok(topfile sys_>< '') -> topfile;
    vedgetlibfilename(vedhelplist, "vedhelpname", topfile) -> topfile;
	unless topfile do
		mishap('NO HELP AVAILABLE', [^topic]);
    elseif islist(topfile) then
		hd(topfile) -> topfile
	endunless;
    discin(topfile) -> topfile;
    until(topfile() ->> c) == termin do cucharout(c) enduntil;
    cucharout(`\n);
enddefine;

endsection;

/*  --- Revision History ---------------------------------------------------
--- Mark Rubinstein, Oct 29 1985 - tidied up, sectionised and lvarsed and made
	to work with (optional) help list format.
 */
