1 /* ELLE - Copyright 1982, 1987 by Ken Harrenstien, SRI International
2 * This software is quasi-public; it may be used freely with
3 * like software, but may NOT be sold or made part of licensed
4 * products without permission of the author.
6 /* EEHELP - Help function
9 #include "elle.h" /* include structure definitions */
13 /* EFUN: "Describe" */
14 /* DESCRIBE - Help-command hack.
15 ** Crude approximation of EMACS function.
17 static struct buffer
*help_buf
;
23 struct buffer
*savbuf
, *b
, *make_buf();
26 saynow("Help for command: ");
27 i
= cmd_idx(c
= cmd_read()); /* Get function idx for cmd */
28 if(c
&CB_META
) sayntoo("M-");
31 i
= cmd_idx(c
= (cmd_read() | CB_META
));
33 else if(i
== FN_PFXEXT
)
35 i
= cmd_idx(c
= (cmd_read() | CB_EXT
));
41 /* Now read in the help file, if necessary */
50 chg_buf(help_buf
= make_buf(" **HELP**"));
51 if(read_file(ev_helpfile
) == 0)
60 /* Find function index in current buffer */
64 cp
= dottoa(cp
, (chroff
)i
);
67 if(e_search(str
, cp
-str
, 0) == 0)
68 sayntoo(" No help found");
72 while(!e_lblankp()) e_gonl(); /* Move past 1st blank line */
73 b
= make_buf(" *SHOW*");
74 sb_sins((SBBUF
*)b
, e_copyn(bdot
- e_dot()));
75 mk_showin(b
); /* Show the stuff */
81 #endif /*FX_DESCRIBE*/