[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime 2581fc2dd9 091/118: org-mime-confirm-when-no-mult
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime 2581fc2dd9 091/118: org-mime-confirm-when-no-multipart function + docs |
Date: |
Wed, 5 Jan 2022 07:58:49 -0500 (EST) |
branch: elpa/org-mime
commit 2581fc2dd95a55ed797808f33b1596bc642cd188
Author: John Borwick <borwick@Greybeard.domain>
Commit: John Borwick <borwick@Greybeard.domain>
org-mime-confirm-when-no-multipart function + docs
---
README.org | 8 ++++++++
org-mime.el | 12 ++++++++++++
2 files changed, 20 insertions(+)
diff --git a/README.org b/README.org
index f53ebdec95..66890a1f89 100644
--- a/README.org
+++ b/README.org
@@ -149,6 +149,14 @@ ASCII export options:
(setq org-mime-export-ascii 'utf-8)
#+end_src
+** Prompt for confirmation if message has no HTML
+
+If you plan to run =org-mime-htmlize= on all your email, you may want a
confirmation if it appears you're sending an email without multipart content.
To do this, add a hook to =message-send-hook= to your init file:
+
+#+begin_src elisp
+(add-hook 'message-send-hook 'org-mime-confirm-when-no-multipart)
+#+end_src
+
* Support legacy Emacs versions
- 0.1.6 is the last version to support Emacs 24
* Development
diff --git a/org-mime.el b/org-mime.el
index 28274c5f10..f2f29761dc 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -788,6 +788,18 @@ Following headline properties can determine the mail
headers,
(t
(message "Can not find plain text mail.")))))
+(defun org-mime-confirm-when-no-multipart ()
+ "Prompts whether to send email if the buffer does not seem to be html-ized"
+ (let ((found-multipart (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (search-forward "<#multipart type=alternative>"
nil t)))))
+ (when (and (not found-multipart)
+ (not (y-or-n-p "org-mime-htmlize not called; send anyway?")))
+ (setq quit-flag t))))
+
+
(provide 'org-mime)
;; Local Variables:
;; coding: utf-8
- [nongnu] elpa/org-mime b9def25bf4 043/118: Edit docstrings for checkdoc compatibility., (continued)
- [nongnu] elpa/org-mime b9def25bf4 043/118: Edit docstrings for checkdoc compatibility., ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 6593522166 051/118: Fix: #22, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ea7a470872 061/118: add badge, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 8de4bb693d 064/118: image could be nil, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime f8eac8ccde 066/118: restore plain text mail, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 95c33ec353 067/118: add screenshot, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 562cb5a3f0 074/118: Use compose-mail, rather than explicitly using message-mail, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 7475a592c2 081/118: drop emacs 24 support, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e81651d848 084/118: clean code, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 9bb6351b25 085/118: un-bundled htmlize.el, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 2581fc2dd9 091/118: org-mime-confirm-when-no-multipart function + docs,
ELPA Syncer <=
- [nongnu] elpa/org-mime 8ad1218456 095/118: Combine two insert calls, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 2cbd5de7bd 100/118: general export options should always override buffer options, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime ecbc66f16a 106/118: fixed typo, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime c6a3d73e78 107/118: remove org-mime-default-header, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 04e6ce9db6 108/118: try fixing ci again, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime eb21c02ba8 109/118: fixed org subtree htmlize, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 21692f16ce 110/118: use buffer properties, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 59bf130c76 113/118: secure tag should be at the beginning of email body, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime df99e631c5 031/118: quoted mail use modern UI style, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e5e4c59022 103/118: fixed some typo, ELPA Syncer, 2022/01/05