mu4e.texi: add example subject-is-empty check

Fixes #2679.
This commit is contained in:
Dirk-Jan C. Binnema
2024-04-05 19:05:42 +03:00
parent 7771a56026
commit dfc179036c

View File

@ -4664,14 +4664,19 @@ final confirmation, which you can of course make as elaborate as you
wish. wish.
@lisp @lisp
(add-hook 'message-send-hook (defun confirm-empty-subject ()
(lambda () "Require confirmation before sending without subject."
(unless (yes-or-no-p "Sure you want to send this?") (let ((sub (message-field-value "Subject")))
(signal 'quit nil)))) (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 @end lisp
Another option is to simply set @code{message-confirm-send} to If you @emph{always} want to be asked for for confirmation, set
non-@t{nil} so the question ``Send message?'' is asked for confirmation. @code{message-confirm-send} to non-@t{nil} so the question ``Send message?'' is
asked for confirmation.
@node How it works @node How it works
@appendix How it works @appendix How it works