summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-06-17 19:56:32 +0100
committerArun Isaac2024-06-17 19:56:32 +0100
commit4bb577f26b112ef6f5ed1171dee831bae33bb4c9 (patch)
tree7c1fb40f2bbc61852aad1e8247b7b19b5d7155b7
parent6d37469f1a8a51fee47772d490d2605902221558 (diff)
downloadvaruga-4bb577f26b112ef6f5ed1171dee831bae33bb4c9.tar.gz
varuga-4bb577f26b112ef6f5ed1171dee831bae33bb4c9.tar.lz
varuga-4bb577f26b112ef6f5ed1171dee831bae33bb4c9.zip
Fill Subject header only if it is blank.
* varuga.el (varuga-invite): Fill Subject header only if it is blank.
-rw-r--r--varuga.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/varuga.el b/varuga.el
index 1d17779..b7e24c3 100644
--- a/varuga.el
+++ b/varuga.el
@@ -138,14 +138,15 @@ is the length of the event in minutes."
(org-duration-to-minutes
(read-string "Duration: "))))
(save-excursion
- ;; Fill Subject header.
- (save-restriction
- (message-narrow-to-headers)
- (re-search-forward "^Subject:")
- (message-narrow-to-field)
- (end-of-line)
- ;; TODO: Allow customization of the Subject format.
- (insert (format "Invitation: %s" summary)))
+ ;; Fill Subject header if it is blank.
+ (when (string-blank-p (message-fetch-field "Subject"))
+ (save-restriction
+ (message-narrow-to-headers)
+ (re-search-forward "^Subject:")
+ (message-narrow-to-field)
+ (end-of-line)
+ ;; TODO: Allow customization of the Subject format.
+ (insert (format "Invitation: %s" summary))))
;; Fill email body.
(goto-char (point-max))
(insert "<#multipart type=mixed>\n")