* mu4e-send.el: update some var names, remove some debuging stuff, fix some

byte-compiling errors
This commit is contained in:
djcb
2012-04-11 02:06:40 +03:00
parent 7950e6b47b
commit 86c4e7042a
2 changed files with 22 additions and 18 deletions

View File

@ -35,6 +35,7 @@
(require 'mail-parse) (require 'mail-parse)
(require 'smtpmail) (require 'smtpmail)
;; internal variables / constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; internal variables / constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst mu4e-send-draft-name "*mu4e-draft*" "Name for draft messages.") (defconst mu4e-send-draft-name "*mu4e-draft*" "Name for draft messages.")
@ -52,7 +53,7 @@ of mu4e and emacs."
line (with the %s's replaced with the date of MSG and the name line (with the %s's replaced with the date of MSG and the name
or e-mail address of its sender (or 'someone' if nothing or e-mail address of its sender (or 'someone' if nothing
else)), followed of the quoted body of MSG, constructed by by else)), followed of the quoted body of MSG, constructed by by
prepending `mu4e-send-citation-prefix' to each line. If there is prepending `mu4e-citation-prefix' to each line. If there is
no body in MSG, return nil." no body in MSG, return nil."
(let* ((from (plist-get msg :from)) (let* ((from (plist-get msg :from))
(body (mu4e-body-text msg))) (body (mu4e-body-text msg)))
@ -65,7 +66,7 @@ of mu4e and emacs."
"someone")) "someone"))
"\n\n" "\n\n"
(replace-regexp-in-string "^" (replace-regexp-in-string "^"
mu4e-send-citation-prefix body))))) mu4e-citation-prefix body)))))
(defun mu4e-send-header (hdr val) (defun mu4e-send-header (hdr val)
"Return a header line of the form HDR: VAL\n. If VAL is nil, "Return a header line of the form HDR: VAL\n. If VAL is nil,
@ -111,7 +112,6 @@ e-mail addresses. If LST is nil, returns nil."
"Return t if cell1 and cell2 have the same e-mail "Return t if cell1 and cell2 have the same e-mail
address (case-insensitively), nil otherwise. cell1 and cell2 are address (case-insensitively), nil otherwise. cell1 and cell2 are
cons cells (NAME . EMAIL)." cons cells (NAME . EMAIL)."
(message "EQ: %S %S" (cdr cell1) (cdr cell2))
(string= (string=
(downcase (or (cdr cell1) "")) (downcase (or (cdr cell1) ""))
(downcase (or (cdr cell2) "")))) (downcase (or (cdr cell2) ""))))
@ -155,11 +155,9 @@ the original message ORIGMSG, and whether it's a reply-all."
cc-lst cc-lst
(delete-if (delete-if
(lambda (cc-cell) (lambda (cc-cell)
(message "cc %S" cc-lst)
(mu4e--address-cell-equal cc-cell (mu4e--address-cell-equal cc-cell
(cons nil user-mail-address))) (cons nil user-mail-address)))
cc-lst)))) cc-lst))))
(message "CC %S" cc-lst)
cc-lst))) cc-lst)))
(defun mu4e--create-recipient-field (field origmsg &optional reply-all) (defun mu4e--create-recipient-field (field origmsg &optional reply-all)
@ -231,12 +229,12 @@ never hits the disk. Also see `mu4e-insert-mail-header-separator."
(concat (concat
(mu4e-send-header "From" (or (mu4e-send-from-create) "")) (mu4e-send-header "From" (or (mu4e-send-from-create) ""))
(mu4e-send-header "Reply-To" mail-reply-to) (mu4e-send-header "Reply-To" mu4e-reply-to-address)
(mu4e-send-header "To" (mu4e--create-recipient-field :to origmsg)) (mu4e-send-header "To" (mu4e--create-recipient-field :to origmsg))
(mu4e-send-header "Cc" (mu4e--create-recipient-field :cc origmsg (mu4e-send-header "Cc" (mu4e--create-recipient-field :cc origmsg
reply-all)) reply-all))
(mu4e-send-header "User-agent" (mu4e-send-user-agent)) (mu4e-send-header "User-agent" (mu4e-send-user-agent))
(mu4e-send-header "References" (mu4e-send-references-create msg)) (mu4e-send-header "References" (mu4e-send-references-create origmsg))
(when old-msgid (when old-msgid
(mu4e-send-header "In-reply-to" (format "<%s>" old-msgid))) (mu4e-send-header "In-reply-to" (format "<%s>" old-msgid)))
@ -244,11 +242,11 @@ never hits the disk. Also see `mu4e-insert-mail-header-separator."
(mu4e-send-header "Subject" (mu4e-send-header "Subject"
(concat (concat
;; if there's no Re: yet, prepend it ;; if there's no Re: yet, prepend it
(if (string-match (concat "^" mu4e-send-reply-prefix) subject) (if (string-match (concat "^" mu4e-reply-prefix) subject)
"" mu4e-send-reply-prefix) "" mu4e-reply-prefix)
subject)) subject))
"\n\n" "\n\n"
(mu4e-send-cite-original msg)))) (mu4e-send-cite-original origmsg))))
(defun mu4e-send-create-forward (origmsg) (defun mu4e-send-create-forward (origmsg)
@ -258,24 +256,24 @@ never hits the disk. Also see `mu4e-insert-mail-header-separator."
(or (plist-get origmsg :subject) ""))) (or (plist-get origmsg :subject) "")))
(concat (concat
(mu4e-send-header "From" (or (mu4e-send-from-create) "")) (mu4e-send-header "From" (or (mu4e-send-from-create) ""))
(mu4e-send-header "Reply-To" mail-reply-to) (mu4e-send-header "Reply-To" mu4e-reply-to-address)
(mu4e-send-header "To" "") (mu4e-send-header "To" "")
(mu4e-send-header "User-agent" (mu4e-send-user-agent)) (mu4e-send-header "User-agent" (mu4e-send-user-agent))
(mu4e-send-header "References" (mu4e-send-references-create origmsg)) (mu4e-send-header "References" (mu4e-send-references-create origmsg))
(mu4e-send-header "Subject" (mu4e-send-header "Subject"
(concat (concat
;; if there's no Re: yet, prepend it ;; if there's no Re: yet, prepend it
(if (string-match (concat "^" mu4e-send-forward-prefix) subject) (if (string-match (concat "^" mu4e-forward-prefix) subject)
"" mu4e-send-forward-prefix) "" mu4e-forward-prefix)
subject)) subject))
"\n\n" "\n\n"
(mu4e-send-cite-original msg)))) (mu4e-send-cite-original origmsg))))
(defun mu4e-send-create-new () (defun mu4e-send-create-new ()
"Create a new message.." "Create a new message.."
(concat (concat
(mu4e-send-header "From" (or (mu4e-send-from-create) "")) (mu4e-send-header "From" (or (mu4e-send-from-create) ""))
(mu4e-send-header "Reply-To" mail-reply-to) (mu4e-send-header "Reply-To" mu4e-reply-to-address)
(mu4e-send-header "To" "") (mu4e-send-header "To" "")
(mu4e-send-header "User-agent" (mu4e-send-user-agent)) (mu4e-send-header "User-agent" (mu4e-send-user-agent))
(mu4e-send-header "Subject" "") (mu4e-send-header "Subject" "")

View File

@ -279,21 +279,27 @@ display with `mu4e-view-toggle-hide-cited (default keybinding:
"Customizations for composing/sending messages." "Customizations for composing/sending messages."
:group 'mu4e) :group 'mu4e)
(defcustom mu4e-send-citation-prefix " > " (defcustom mu4e-citation-prefix " > "
"String to prefix cited message parts with." "String to prefix cited message parts with."
:type 'string :type 'string
:group 'mu4e-compose) :group 'mu4e-compose)
(defcustom mu4e-send-reply-prefix "Re: " (defcustom mu4e-reply-prefix "Re: "
"String to prefix the subject of replied messages with." "String to prefix the subject of replied messages with."
:type 'string :type 'string
:group 'mu4e-compose) :group 'mu4e-compose)
(defcustom mu4e-send-forward-prefix "Fwd: " (defcustom mu4e-forward-prefix "Fwd: "
"String to prefix the subject of forwarded messages with." "String to prefix the subject of forwarded messages with."
:type 'string :type 'string
:group 'mu4e-compose) :group 'mu4e-compose)
(defcustom mu4e-reply-to-address nil
"The Reply-To address (if this, for some reason, is not equal to
the From: address.)"
:type 'string
:group 'mu4e-compose)
(defcustom mu4e-user-agent nil (defcustom mu4e-user-agent nil
"The user-agent string; leave at `nil' for the default." "The user-agent string; leave at `nil' for the default."
:type 'string :type 'string