home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / JED / JED097-1.TAR / jed / lib / abbrev.sl next >
Encoding:
Text File  |  1994-12-12  |  833 b   |  48 lines

  1.  
  2.  
  3. !if (is_defined ("Abbrev_File"))
  4. {
  5.    variable Abbrev_File;
  6.    $1 = getenv ("JED_HOME");
  7.    !if (strlen ($1))
  8.      {
  9.     $1 = getenv ("HOME");
  10.      }
  11.    
  12. #ifdef VMS
  13.    if (0 == strlen ($1))
  14.      {
  15.     Abbrev_File = "SYS$LOGIN:abbrevs.sl";
  16.      }
  17.    else Abbrev_File = dircat ($1, Abbrev_File);
  18. #else
  19.    
  20. #ifdef MSDOS OS2
  21.    Abbrev_File = "abbrevs.sl";
  22. #else
  23.    Abbrev_File = ".abbrevs.sl";
  24. #endif
  25.    Abbrev_File = dircat ($1, Abbrev_File);
  26. #endif % VMS 
  27. }
  28.  
  29. if (file_status (Abbrev_File) > 0) pop (evalfile (Abbrev_File));
  30.  
  31. define set_abbrev_mode (val)
  32. {
  33.    getbuf_info ();
  34.    if (val) () | 0x800; else () & ~(0x800);
  35.    setbuf_info(());
  36. }
  37.  
  38. define abbrev_mode ()
  39. {
  40.    variable flags = getbuf_info() xor 0x800;
  41.    variable msg = "Abbrev mode OFF";
  42.    setbuf_info(flags);
  43.    if (flags & 0x800) msg = "Abbrev mode ON";
  44.    message (msg);
  45. }
  46.  
  47.  
  48.