home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / emacs / help / 5063 < prev    next >
Encoding:
Text File  |  1992-12-12  |  2.0 KB  |  68 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!hrue
  3. From: hrue@sima.sintef.no (hrue)
  4. Subject: Re: How to convert from Babyl (RMAIL) format back to Mail?  HELP!
  5. In-Reply-To: jkh@whisker.lotus.ie's message of Sat, 12 Dec 1992 03:00:20 GMT
  6. Message-ID: <HRUE.92Dec12103941@nazgul.sima.sintef.no>
  7. Sender: news@ugle.unit.no (NetNews Administrator)
  8. Organization: SINTEF Industrial Mathematics, Trondheim, Norway
  9. References: <JKH.92Dec12030020@whisker.lotus.ie>
  10. Distribution: gnu
  11. Date: 12 Dec 92 10:39:41
  12. Lines: 54
  13.  
  14.  
  15. something i picked up somewhere, sometime.
  16. -hr
  17.  
  18. ----------------------------------------------------------------------
  19. #!/bin/sh
  20. #
  21. # usage:    rmail-to-mail file1 file2 ...
  22. #
  23. # result:    file1~     is the original Babyl file
  24. #        file1      is an empty Babyl file
  25. #        file1.mail is a UNIX mail file with the messages from file1
  26.  
  27. if [ $# -eq 0 ]; then
  28.     cat $0
  29.     exit 
  30. fi
  31.  
  32.  
  33. cat > /tmp/$$.el << EOF
  34. ;;;
  35. ;;; Author:  Nathan Hess  (woodstock@hobbes.intel.com)
  36. ;;;
  37. ;;
  38.  
  39. (let ((file-to-be-converted (buffer-file-name))
  40.       (message-count 0)
  41.       (rmail-delete-after-output t)
  42.       (unix-style-file-name (concat (buffer-file-name) ".mail")))
  43.   (kill-buffer (current-buffer))
  44.   (rmail file-to-be-converted)
  45.   (rmail-show-message 1)
  46.   (while (not (rmail-output unix-style-file-name))
  47.     (setq message-count (1+ message-count)))
  48.   (rmail-quit))
  49. EOF
  50.  
  51. for f in "$@" ; do
  52.     echo ">>> Doing $f"
  53.     emacs -batch $f -l /tmp/$$.el -kill
  54.     echo ">>> Done"
  55. done
  56.  
  57. rm -f /tmp/$$.el
  58. ----------------------------------------------------------------------
  59. --
  60.        |^^^^^^|        ___________________________________
  61.        |      |       /                                    \
  62.        |      |      | Haavard Rue                          |
  63.        | (o)(o)      | The Norwegian Instiute of Technology |
  64.       @      _)      | Department of Mathemathical Sciences |
  65.        | ,___|     ,,| N-7034 Trondheim NTH, Norway         |
  66.        |   /   ..''  | fax:+47-7-593524, hrue@imf.unit.no   |
  67.       /____\          \____________________________________/
  68.