home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume8 / micrognu / part03 / prefix.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-01-26  |  1.1 KB  |  47 lines

  1. /*
  2.  * This code is a kludge for the two prefix sequences from GNU (well,
  3.  * the two I want) that uemacs doesn't have. Rather than quadruple the table
  4.  * space for keys, plus have to test for them everywhere, I'll just kludge
  5.  * it with functions that are bound to those keys. Later, maybe I'll do
  6.  * prefixes right.
  7.  */
  8.  
  9. #include "def.h"
  10.  
  11. /*ARGSUSED*/
  12. ctlx4hack(f, n, k) {
  13.     register KEY    c;
  14.  
  15.     if ((c = getkey(KPROMPT)) == 'b' || c == 'B')
  16.         return poptobuffer(f, n, KRANDOM);
  17.     if (c == 'f' || c == (KCTRL|'F') || c == 'F')
  18.         return poptofile(f, n, KRANDOM);
  19.     
  20.     if (c == (KCTRL|'G') || c == (KCTLX|KCTRL|'G')
  21.     ||  c == (KMETA|KCTRL|'G')) {
  22.         (VOID) ctrlg(FALSE, 1, KRANDOM);
  23.         return ABORT;
  24.     }
  25.     return FALSE;
  26. }
  27.  
  28. /*ARGSUSED*/
  29. help(f, n, k) {
  30.     register KEY    c;
  31.  
  32.     c = getkey(KPROMPT);
  33.     while (c == (KCTRL|'H')) {
  34.         ewprintf("B C: ");
  35.         c = getkey(0);
  36.     }
  37.     if (c == 'b' || c == 'B') return wallchart(f, n, KRANDOM);
  38.     if (c == 'c' || c == 'C') return desckey(f, n, KRANDOM);
  39.  
  40.     if (c == (KCTRL|'G') || c == (KCTLX|KCTRL|'G')
  41.     ||  c == (KMETA|KCTRL|'G')) {
  42.         (VOID) ctrlg(FALSE, 1, KRANDOM);
  43.         return ABORT;
  44.     }
  45.     return FALSE;
  46. }
  47.