1. Arne Babenhauserheide
  2. .emacs.d

Commits

Arne Babenhauserheide  committed 87a8bd9

do this automatically for sent mails

  • Participants
  • Parent commits db8fc47
  • Branches fluss

Comments (0)

Files changed (1)

File lisplets/bbdb-timed-notes.el

View file
  • Ignore whitespace
         (bbdb-redisplay-one-record bbdb-record)))
   nil)
 
+; do this automatically for sent mails
+
+(defun wicked/message-add-subject-to-bbdb-record ()
+  "Add datestamped subject note for each person this message has been sent to."
+  (let* ((subject (concat (format-time-string "%Y.%m.%d")
+                          ": E-mail: " (message-fetch-field "Subject") "\n"))
+         (bbdb-get-addresses-headers
+          (list (assoc 'recipients bbdb-get-addresses-headers)))
+         records)
+    (setq records
+          (bbdb-update-records
+           (bbdb-get-addresses nil gnus-ignored-from-addresses 'gnus-fetch-field)
+           nil nil))
+    (mapc (lambda (rec)
+            (bbdb-record-putprop rec
+                                 'contact
+                                 (concat subject
+                                         (or
+                                          (bbdb-record-getprop rec 'contact)
+                                          ""))))
+          records)))
+(add-hook 'message-send-hook 'wicked/message-add-subject-to-bbdb-record)
+
 (provide 'bbdb-timed-notes)