From dfc179036cded6cbc8622f96a2c6baa7e85c0d36 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Fri, 5 Apr 2024 19:05:42 +0300 Subject: [PATCH] mu4e.texi: add example subject-is-empty check Fixes #2679. --- mu4e/mu4e.texi | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index 823a23c1..5fb39b1c 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -4664,14 +4664,19 @@ final confirmation, which you can of course make as elaborate as you wish. @lisp -(add-hook 'message-send-hook - (lambda () - (unless (yes-or-no-p "Sure you want to send this?") - (signal 'quit nil)))) +(defun confirm-empty-subject () + "Require confirmation before sending without subject." + (let ((sub (message-field-value "Subject"))) + (or (and sub (not (string-match "\\`[ \t]*\\'" sub))) + (yes-or-no-p "Really send without Subject? ") + (keyboard-quit)))) + +(add-hook 'message-send-hook #'confirm-empty-subject) @end lisp -Another option is to simply set @code{message-confirm-send} to -non-@t{nil} so the question ``Send message?'' is asked for confirmation. +If you @emph{always} want to be asked for for confirmation, set +@code{message-confirm-send} to non-@t{nil} so the question ``Send message?'' is +asked for confirmation. @node How it works @appendix How it works