[Patch v3 2/2] emacs: postpone/resume support
Mark Walters
markwalters1009 at gmail.com
Sun Nov 6 02:29:35 PST 2016
> +(defun notmuch-draft--check-encryption-tag ()
> + "Query user if there an mml tag that looks like it might indicate encryption.
> +
> +Returns t if there is no such tag, or the user confirms they mean
> +it."
> + (save-excursion
> + (message-goto-body)
> + (or
> + ;; We are fine if no relevant tag is found, or
> + (not (re-search-forward notmuch-draft-encryption-tag-regex nil 't))
> + ;; The user confirms they means it.
> + (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
> +This message contains mml tags that suggest it is intended to be encrypted.
> +Really save and index an unencrypted copy? "))))
> +
> +(defun notmuch-draft-save ()
> + "Save the current draft message in the notmuch database.
> +
> +This saves the current message in the database with tags
> +`notmuch-draft-draft-tags` (in addition to any default tags
> +applied to newly inserted messages)."
> + (interactive)
> + (case notmuch-draft-save-plaintext
> + ((ask)
> + (unless (notmuch-draft--check-encryption-tag)
> + (error "Save aborted")))
> + ((t)
> + (ignore))
> + ((nil)
> + (error "Refusing to save draft with encryption tags (see `notmuch-draft-save-plaintext')")))
Hi
Did you mean for the case when notmuch-draft-save-plaintext is nil to
abort in all cases, not just when there is an mml secure tag? (I haven't
tested but it looks like that is what happens above)
Best wishes
Mark
More information about the notmuch
mailing list