home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34src.zip
/
me3
/
mutt
/
package
/
mailmode.mut
< prev
next >
Wrap
Text File
|
1995-01-14
|
4KB
|
150 lines
;; mailmode.mut : Stuff for replying to or composing mail/notes messages.
;; A super set of text mode.
;; Routines:
;; mail-quote-region:
;; Put a symbol infront of each line of text (ignore empty lines) in
;; the region to indicate that somebody else wrote it.
;; C Durland Public Domain
(const quoter "> ") ;; what to put in front of quoted text
(include me.mh)
(small-int mail-mode-keymap)
(defun
mail-mode
{
(text-mode)
(minor-mode "Mail")
(if (== 0 mail-mode-keymap)
{
(mail-mode-keymap (create-keymap LOCAL-KEYMAP))
(bind-key mail-mode-keymap "mail-format-quote-region" "M-`")
})
(install-keymap mail-mode-keymap LOCAL-KEYMAP)
(if (pgm-exists "mail-mode-hook") (floc "mail-mode-hook"()))
}
)
(include runblock.mut)
(defun
what-do-you-want-to-quote-with (bool ask-them) HIDDEN
{
(if ask-them
; { (ask-user) (concat (ask "what do you want to quote with? ") quoter) }
{ (ask-user) (ask "what do you want to quote with? ") }
quoter
)
}
mail-quote-region
{
(run-pgm-on-block (floc quote-a-line-of-text)
(what-do-you-want-to-quote-with (arg-flag)))
}
mail-format-quote-region
{
; (byte type)(small-int left-edge width height)(int size) ;; RegionInfo
; (int mark-id)
; (string the-quote)
;
; (region-stats (loc type) THE-DOT THE-MARK TRUE)
; (the-quote (what-do-you-want-to-quote-with (arg-flag)))
;
; (set-mark (mark-id (create-mark)))
; (adjust-lines height
; (- (if (== 0 (word-wrap)) 72 (word-wrap)) (length-of the-quote))
; FALSE)
; (forward-line -1)(set-mark)
; (goto-mark mark-id)(free-mark mark-id)
; (run-pgm-on-block (floc quote-a-line-of-text) the-quote)
(byte type)(small-int left-edge width height)(int size) ;; RegionInfo
(string the-quote)
(region-stats (loc type) THE-DOT THE-MARK TRUE)
(the-quote (what-do-you-want-to-quote-with (arg-flag)))
(save-point
{{ ;; args: (int height)(string the-quote)
(adjust-lines (arg 0)
(- (if (== 0 (word-wrap)) 72 (word-wrap)) (length-of (arg 1)))
FALSE)
(forward-line -1)(set-mark)
}}
height the-quote) ;;!!!???
(run-pgm-on-block (floc quote-a-line-of-text) the-quote)
}
)
;;;;;;;;;;;;;;;;;;;;;;;;; details ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun
quote-a-line-of-text (string quoter) HIDDEN
{
(if (looking-at '\ *$')
{ (arg-prefix 1)(cut-line)(open-line) } ;; clear blank line
(insert-text quoter)) ;; add the quote mark
}
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;; Talk to Mailer ;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun
mail-region
{
(int bag)
(string to subject)
(bag (create-bag))
(append-to-bag bag APPEND-REGION)
(to (ask "Mail region to: "))
(subject (ask "Subject: "))
(OS-filter (concat "mailx -s " "\"" subject "\" " to) bag)
}
)
(int mail-buffer)
(const COMPOSE-MAIL-BUFFER-NAME "*compose-mail*")
(defun
mail-compose
{
(int mail-window)
(if (== -2 (mail-buffer (attached-buffer COMPOSE-MAIL-BUFFER-NAME)))
{
(mail-buffer
(create-buffer COMPOSE-MAIL-BUFFER-NAME BFHuman))
(current-buffer mail-buffer)
(mail-mode)
(insert-text "To: ^J")
(insert-text "Subject: ^J")
(insert-text "Cc: ^J")
(insert-text "Bcc: ^J")
(insert-text "")
(beginning-of-buffer)(end-of-line)
})
(current-window (mail-window (popup-buffer mail-buffer)))
}
; mail-compose-send
; {
; (int bag)
;
; (save-point
; {{
; (beginning-of-buffer)
; (append-to-bag (arg 0) APPEND-CHARACTERS 99999999)
; }} (bag (create-bag)))
;
; (OS-filter (concat "rmail craig@cv") bag) ;;;!!!????
; }
)