X-Git-Url: https://git.cworth.org/git?p=notmuch-wiki;a=blobdiff_plain;f=emacstips.mdwn;fp=emacstips.mdwn;h=288690c0c165211436bb7c9348544d91b2dd8d58;hp=19c354ac3520775e0c840dc4a320808642d6bf11;hb=d8d37483ddfdf589c309acd0b3e1c897f9749307;hpb=eb4b6e7352077be8bb5ab1223218a38925723561 diff --git a/emacstips.mdwn b/emacstips.mdwn index 19c354a..288690c 100644 --- a/emacstips.mdwn +++ b/emacstips.mdwn @@ -936,6 +936,21 @@ it recognise English and Portuguese terms: "\\b\\(attach\\|attachment\\|attached\\|anexo\\|anexado\\)\\b") +## Avoid forgetting the subject + +It happens that we forget to enter the Subject line, particularly when +we leave that to the end. It's easy to write a function that checks +whether the Subject is empty, and add it to `message-send-hook` to get +confirmation: + + (defun my-notmuch-mua-empty-subject-check () + "Request confirmation before sending a message with empty subject" + (when (and (null (message-field-value "Subject")) + (not (y-or-n-p "Subject is empty, send anyway? "))) + (error "Sending message cancelled: empty subject."))) + (add-hook 'message-send-hook 'my-notmuch-mua-empty-subject-check) + + ## Applying patches to git repositories The `notmuch-extract-thread-patches` and