Function: message-mailto-1

message-mailto-1 is a byte-compiled function defined in message.el.gz.

Signature

(message-mailto-1 URL &optional SUBJECT BODY FILE-ATTACHMENTS)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message-mailto-1 (url &optional subject body file-attachments)
  (let ((args (message-parse-mailto-url url))
        (need-body nil) (need-subject nil))
    (dolist (arg args)
      (unless (equal (car arg) "body")
	(message-position-on-field (capitalize (car arg)))
	(insert (string-replace
		 "\r\n" "\n"
		 (mapconcat #'identity (reverse (cdr arg)) ", ")))))
    (if (assoc "body" args)
        (progn
          (message-goto-body)
          (dolist (body (cdr (assoc "body" args)))
	    (insert body "\n")))

      (setq need-body t))
    (if (assoc "subject" args)
	(message-goto-body)
      (setq need-subject t)
      (message-goto-subject))
    ;; If either one of need-subject and need-body is non-nil then
    ;; attempt to insert the absent information from an external
    ;; SUBJECT or BODY.
    (when (or need-body need-subject)
      (when (and need-body body)
        (message-goto-body)
        (insert body))
      (when (and need-subject subject)
        (message-goto-subject)
        (insert subject)
        (message-goto-body)))
    ;; Subsequently insert each attachment enumerated within
    ;; FILE-ATTACHMENTS.
    (dolist (file file-attachments)
      (mml-attach-file file nil 'attachment))))