home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / EMACSPAT.ZIP / YESNO.MIN < prev   
Encoding:
Text File  |  1990-04-10  |  1.2 KB  |  45 lines

  1. Sincerely,            |     Mail:  LtCol James A. Lupo
  2.                 |         AFOSR/NP, Bldg 410
  3.     Jim Lupo        |         Bolling AFB, DC   20332-6448
  4.                 |    Phone:  (202) 767-4908
  5.                 | Internet:  lupo@hqafsc-vax.af.mil
  6.                 |         (26.2.0.67)
  7.  
  8. { YES-NO }
  9.  
  10.     GNU Emacs promts with (y or n) or (yes or no).  Used '[]' instead
  11.         of '()'.  ( How do you print a '(' ?? )
  12.  
  13. Name:Fy-or-n
  14. #(Fy-or-n,PROMPT,FUNCT) will wait for a key and execute FUNCT using #(Fr) if
  15. that key is 'y' or 'n'.  Doesn't execute FUNCT if C-g (cancel) is pressed.
  16. It keeps trying until a recognized key is hit.
  17. [*]#(an,arg1 ((y/n)) )
  18. #(Fcase,#(g)#(an),
  19.     (y,(#(Fr,(arg2),y))),
  20.     (n,(#(Fr,(arg2),n))),
  21.     (C-g,()),
  22.     (
  23.         #(Fflush-input-buffer)
  24.         #(SELF,(arg1),(arg2))
  25.     )
  26. )[*]
  27.  
  28. Name:Fyes-or-no
  29. #(Fyes-or-no,PROMPT,YES,NO) will read a line and execute YES if
  30. that line is 'yes'.  It will execute NO if the line is 'no'.
  31. It keeps trying until a recognized word is entered.
  32. [*]#(ds,value)
  33. #(Freadline,(arg1 ((yes/no)) ),(
  34.     #(Fcase,##(value),
  35.         (yes,(arg2)),
  36.         (no,(arg3)),
  37.         (
  38.             #(an,Please enter 'yes' or 'no'.)
  39.             #(ds,temp,##(it,200))
  40.             #(==,##(temp),Timeout,,(#(Fkbd-in,##(temp))))
  41.             #(SELF,(arg1),(arg2),(arg3))
  42.         )
  43.     )
  44. ))[*]
  45.