X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=emacs%2Fnotmuch-draft.el;h=9ce9e736e4a6c36a4b323664097ab0a3508919c8;hb=2ca941163da06aed564dab1990fb333fd7457ec2;hp=f928be876a906c013f9ec13d345e9d95211461ba;hpb=adc123e4fd6384fba0165ebddc99d4323f6bee73;p=notmuch diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el index f928be87..9ce9e736 100644 --- a/emacs/notmuch-draft.el +++ b/emacs/notmuch-draft.el @@ -31,6 +31,8 @@ (declare-function notmuch-show-get-message-id "notmuch-show" (&optional bare)) (declare-function notmuch-message-mode "notmuch-mua") +;;; Options + (defgroup notmuch-draft nil "Saving and editing drafts in Notmuch." :group 'notmuch) @@ -85,6 +87,8 @@ like they are intended to be sent encrypted :group 'notmuch-draft :group 'notmuch-crypto) +;;; Internal + (defvar notmuch-draft-encryption-tag-regex "<#\\(part encrypt\\|secure.*mode=.*encrypt>\\)" "Regular expression matching mml tags indicating encryption of part or message.") @@ -169,6 +173,8 @@ Really save and index an unencrypted copy? ") ;; but notmuch doesn't want that form, so remove them. (concat "draft-" (substring (message-make-message-id) 1 -1))) +;;; Commands + (defun notmuch-draft-save () "Save the current draft message in the notmuch database. @@ -226,6 +232,7 @@ applied to newly inserted messages)." (defun notmuch-draft-resume (id) "Resume editing of message with id ID." + ;; Used by command `notmuch-show-resume-message'. (let* ((tags (process-lines notmuch-command "search" "--output=tags" "--exclude=false" id)) (draft (equal tags (notmuch-update-tags tags notmuch-draft-tags)))) @@ -265,10 +272,10 @@ applied to newly inserted messages)." ;; message is resaved or sent. (setq notmuch-draft-id (and draft id))))) +;;; _ (add-hook 'message-send-hook 'notmuch-draft--mark-deleted) - (provide 'notmuch-draft) ;;; notmuch-draft.el ends here