[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mailing a file from lisp



Try this

;;; -*- Mode: LISP; Syntax: Zetalisp; Package: ZWEI; Base: 10 -*-

(DEFFLAVOR MY-DRAFT-MSG
	(PATHNAME)
	(DRAFT-MSG)
  (:INITABLE-INSTANCE-VARIABLES PATHNAME))

;;; The inherited method access a global variable instead of the instance.
(DEFMETHOD (:TEXT MY-DRAFT-MSG) ()
  REPLY-INTERVAL)

;;; The inherited method uses the typein-window.
(DEFMETHOD (:REPORT-STREAM MY-DRAFT-MSG) ()
  STANDARD-OUTPUT)

(DEFMETHOD (:DO-IT MY-DRAFT-MSG) ()
  ;; Intercept a couple of likely UI functions.
  (LETF ((#'TYPEIN-LINE #'(LAMBDA (STRING &REST ARGS) (LEXPR-FUNCALL #'FORMAT T STRING ARGS)))
	 (#'BARF #'FERROR))
    (SEND SELF :RESTORE-DRAFT-FILE)
    (SEND SELF :CONTINUE-AND-TRANSMIT)))

(DEFUN SEND-A-FILE (PATHNAME)
  (SEND (MAKE-INSTANCE 'MY-DRAFT-MSG :PATHNAME PATHNAME) :DO-IT))