* fix mu4e-sent-messages-behavior for 'delete when user hasn't saved draft

This commit is contained in:
djcb
2012-03-30 09:15:52 +03:00
parent 5daa703678
commit 79f3289a25
2 changed files with 17 additions and 19 deletions

View File

@ -139,11 +139,11 @@ the current list of headers."
(let* ((marker (gethash docid mu4e-msg-map))
(pos (and marker (marker-position marker)))
(docid-at-pos (and pos (mu4e-hdrs-get-docid pos))))
(unless marker (error "Message %d not found" docid))
(when marker
(unless (eq docid docid-at-pos)
(error "At point %d, expected docid %d, but got %S"
pos docid docid-at-pos))
(mu4e-hdrs-remove-header docid pos)))))
(mu4e-hdrs-remove-header docid pos))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -304,9 +304,10 @@ use the new docid. Returns the full path to the new message."
(lambda() (mu4e-proc-add (buffer-file-name) mu4e-drafts-folder)))
;; notify the backend that a message has been sent. The backend will respond
;; with (:sent ...) sexp, which is handled in .
;; with (:sent ...) sexp, which is handled in `mu4e-send-compose-handler'.
(add-hook 'message-sent-hook
(lambda ()
(basic-save-buffer)
(mu4e-proc-sent (buffer-file-name) mu4e-drafts-folder)))
;; register the function; this function will be called when the '(:sent...)'
@ -379,9 +380,6 @@ using Gnus' `message-mode'."
"Handler function, called with DOCID and PATH for the just-sent
message."
(with-current-buffer (find-file-noselect path)
;; make sure this buffer is saved
(save-buffer)
(message "Mail sent")
;; for Forward ('Passed') and Replied messages, try to set the appropriate
;; flag at the message forwarded or replied-to
(mu4e-send-set-parent-flag docid path)
@ -410,7 +408,7 @@ buffer."
(if (search-forward-regexp (concat "^" mail-header-separator))
(replace-match "")
(error "cannot find mail-header-separator"))
(save-buffer)
(basic-save-buffer)
(message nil)
;; ok, all seems well, well move the message to the sent-folder
(if (eq mu4e-sent-messages-behavior 'trash)