HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/jed/lib/jedhelp.sl
%
%  This is supposed to be an easy to use help facility
%

$1 = " *EZhelp*";

ifnot (keymap_p($1))
{
   make_keymap($1);
   definekey("page_up",		"^?", $1);
   definekey("page_up",		"u", $1);
   definekey("page_up",		"U", $1);
   definekey("page_down",	" ", $1);
   definekey("page_down",	"d", $1);
   definekey("page_down",	"D", $1);
   definekey("search_forward",	"S", $1);
   definekey("search_forward",	"F", $1);
   definekey("search_forward",	"f", $1);
   definekey("search_forward",	"s", $1);
   definekey("search_backward",	"b", $1);
   definekey("search_backward",	"B", $1);
   definekey("ezhelp_quit",	"q", $1);
   definekey("ezhelp_quit",	"Q", $1);
}

variable EZhelp_Last_Buffer;

define ezhelp_quit()
{
   sw2buf(EZhelp_Last_Buffer);
}

define jed_easy_help(file)
{
   variable c, hlpbuf, hlpfile, err, flags, dir;
   hlpbuf = " *EZhelp*";
   ifnot (strcmp(hlpbuf, whatbuf())) return;
   EZhelp_Last_Buffer = whatbuf();
   err = strcat("Help file not found: ", file);
   ERROR_BLOCK
     {
	ezhelp_quit();
     }

   sw2buf(hlpbuf);
   (hlpfile, dir, hlpbuf, flags) = getbuf_info();

   if (strcmp(hlpfile, file))
     {
	hlpfile = expand_jedlib_file(file);
	ifnot (strlen(hlpfile)) error(err);
	erase_buffer();
	set_readonly(0);
	if (insert_file(hlpfile) <= 0) error(err);
	setbuf_info(file, dir, hlpbuf, flags);
	bob();
	set_readonly(1);
     }
   use_keymap(hlpbuf);
   set_status_line(" u:Page Up, d:Page Down, s:Search, q:Quit Help  (%p)", 0);
}