* mu4e-send.el: automatically include message signature if it's set

This commit is contained in:
djcb
2012-03-31 14:22:06 +03:00
parent e7e84ed08a
commit 60826d7ccb

View File

@ -1,6 +1,6 @@
;; mu4e-send.el -- part of mm, the mu mail user agent ;; mu4e-send.el -- part of mm, the mu mail user agent
;; ;;
;; Copyright (C) 2011 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2012 Dirk-Jan C. Binnema
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
@ -296,7 +296,6 @@ use the new docid. Returns the full path to the new message."
(use-local-map mu4e-edit-mode-map) (use-local-map mu4e-edit-mode-map)
(message-hide-headers) (message-hide-headers)
(make-local-variable 'after-save-hook) (make-local-variable 'after-save-hook)
;; update the db when the file is saved...] ;; update the db when the file is saved...]
@ -370,6 +369,12 @@ using Gnus' `message-mode'."
(mml-attach-file (mml-attach-file
(plist-get att :file-name) (plist-get att :mime-type)))) (plist-get att :file-name) (plist-get att :mime-type))))
;; include the message header if it's set; but not when editing an existing
;; message
(unless (eq compose-type 'edit)
(when message-signature
(message-insert-signature)))
(if (member compose-type '(new forward)) (if (member compose-type '(new forward))
(message-goto-to) (message-goto-to)
(message-goto-body)))) (message-goto-body))))
@ -445,7 +450,7 @@ buffer.
(let ((refs)) (let ((refs))
(while (re-search-forward "<[^ <]+@[^ <]+>" nil t) (while (re-search-forward "<[^ <]+@[^ <]+>" nil t)
(push (match-string 0) refs)) (push (match-string 0) refs))
;; the last will the first ;; the last will be the first
(setq forwarded-from (first refs)))))) (setq forwarded-from (first refs))))))
;; remove the <> ;; remove the <>
(when (and in-reply-to (string-match "<\\(.*\\)>" in-reply-to)) (when (and in-reply-to (string-match "<\\(.*\\)>" in-reply-to))