home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 05_common.mo / usr / share / elvis-2.2_0 / scripts / mailto.ex < prev    next >
Encoding:
Text File  |  2004-02-22  |  1.2 KB  |  41 lines

  1. " This script attempts to define the mailto: and man: protocols.  This
  2. " feature of elvis is still changing rapidly, so this might not work.
  3. " Also, the mailto: alias only works on Unix-like systems.
  4.  
  5. alias readMAILTO {
  6.   "initialize a mailto: message
  7.   se noro reol=text
  8.   if exists($HOME/".signature")
  9.   then {
  10.     read ~/.signature
  11.     1 i --
  12.   }
  13. }
  14. alias writeMAILTO {
  15.   "send a mailto: message
  16.  
  17.   " This is a lot more complex that one would think.  The mail program forks
  18.   " off a spooler, and the spooler inherits the stdout/stderr file descriptors.
  19.   " This has the unfortunate side-effect of making elvis wait until the mail
  20.   " queue is emptied, after this message and any other pending messages have
  21.   " been uploaded to the mailserver.  Yuck!  To avoid that, we redirect the
  22.   " mail program's stdout/stderr to /dev/null.
  23.   w !!mail -s"!(no subject)subject=" !2 >/dev/null 2>&1
  24.   se nomod
  25. }
  26.  
  27. alias readMAN {
  28.  local report=0 nosaveregexp
  29.  local magic magicchar=^$.[* noignorecase
  30.  r !!man !2
  31.  set bd=man
  32.  try 1 s/^Reformatting.*ait\.\.\.$//
  33.  try % s/\\/\\\\/g
  34.  try % s/_\(.\)/\\fI\1\\fR/g
  35.  try % s/.\(.\)/\\fB\1\\fR/g
  36.  try % s/\\fR\\fB//g
  37.  try % s/\\fR\\fI//g
  38.  1 i .nf
  39.  set nomod
  40. }
  41.