Subject: MOOmail from mud.el

From: [email-masked]
Date: Mon, 1 Feb 1993 21:50:12 -0800

In a brave attempt to answer my own question....

Here's a patch for mud.el that will do a bit of moo mail.
It has these problems:
* You want to use ^c^c to finish and never ^c^s, or you'll
  insert lines into your message more than once.
* If you type ^c^] you're still in the mailer.
* If you use it while you have an unfinished editing session,
  it will be unhappy
* I mapped it to ^c^a for mAil, since ^cm is used for opening
  a MUD connnection.  Anyone have a better key suggestion?

Suggestions on how to improve it welcome!

(defun moo-mail ()
  "Semi-functional way to send MOO mail."
  (interactive)
  (let* ((person (read-string "Send MOOmail to:  "))
        (subject (read-string "Subject:  ")))
    (setq
        mud-current-process (get-buffer-process (current-buffer))
        moo-buffer (get-buffer-create subject)
        moo-state 'waiting)
    ; put the subject in quotes, if it isn't already
    (if (not (equal (aref subject 0) 34))
        (setq subject (concat "\"" subject "\"")))
    (moo-set-delimiter moo-suffix)
    (pop-to-buffer moo-buffer)
    (moo-code-mode)
    (erase-buffer)
    (insert "enter\n\n.\nsend\n")
    (goto-line 2)
    (mud-send-string
     (concat "@send " person " subject=" subject "\n")
     mud-current-process)))