6077 comments
2357 subscribers
6198 on Twitter
Subscribe! Feed reader E-mail

Emacs: Keep track of messages sent

Because a Big Brother Database of my contacts isn’t complete if I
don’t keep track of what e-mail I sent them and when I sent it, this
bit of Emacs Lisp code adds Gnus subjects to the BBDB records of the
people to whom I sent e-mail.

(defun sacha/gnus-add-subject-to-bbdb-record ()
  "Add datestamped subject note for each person this message has been sent to."
  (let* ((subject (concat (planner-today)
                          ": 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-set-notes rec
                                   (concat subject
                                           (bbdb-record-notes rec))))
            records)))
(add-hook 'message-send-hook 'sacha/gnus-add-subject-to-bbdb-record)

It should be really easy to set up Gnus to expand some kind of
!followup macro into a TODO item in my planner and an “I hope to hear
from you by ….”. Ridiculously easy with Emacs Lisp and an insanely
customizable editor, but I might not have enough battery life. I’ve
got 28 minutes, and then I’m off PC for a while.

On Technorati: , , , ,

/mnt/media/sacha/notebook/emacs/dotgnus.el

Short URL: http://sachachua.com/blog/p/3819

On This Day...

  • 2012: Weekly review: Week ending August 31, 2012 — Lots of sleep this week. =) Lots of connecting with people, too, and lots of drawing! Looking forward to focusing on [...]
  • 2011: Transcript: Blogging (Part 1): Blogging and introverts — Hat-tip to Holly Tse for organizing this interview! After I transcribed it, I realized we managed to pack more than [...]
  • 2010: It’s okay if you can’t remember or spell my name; being human — Lifehacker had a recent post with tips on how to remember people’s names – generally useful tips, ground well-covered in [...]
  • 2009: A teacher’s guide to Web 2.0 at school [illustrated] — A Teacher's Guide To Web 2.0 at School View more documents from Sacha Chua.
  • 2008: Hacking the Domestic — W- and I unboxed and set up our very own sewing machine yesterday. It’s nothing fancy, just a Singer Simple [...]
  • 2006: More Emacs fun: Composing mail to everyone with notes — (defun sacha/compose-mail-to-everyone (&optional subject) (mapc (lambda (rec) (setq rec (car [...]
  • 2006: More Emacs coolness: List of contacts — This bit of Emacs Lisp code produces a Planner-ready list of the contacts displayed in the BBDB window. (defun sacha/planner-bbdb-annotation-from-bbdb (&optional [...]
  • 2006: The great laptop ad campaign — BarCampEarthToronto was a blast, and so was my laptop ad campaign. It didn’t generate any qualified leads, but it did get [...]
  • 2005: Progress at cooking! — I had microwaved the chicken and slathered on barbecue sauce when I realized something important: I was out of cooked-and-frozen rice. [...]
  • 2003: Funky binder — I have printed out hard copies of some of the things I’m working on in school. Time to see how useful [...]
  • 2003: 今日 — 日本語 — アコースティックギターを一寸習いました。エリクさんは教えます。つまびで が楽しかったです。チョロヅが難しかったです。ギターより歌が好きです。でも、 習ってが良いです。 一昨日が妙です。 二人とスクラブルをしました。双方は私が好きでしょう。愛 しい一人と言いました。私は、あの事が未定です。
  • 2003: Hyperdictionary — Andy Sy posted a link to http://www.hyperdictionary.com .
  • 2003: Top Ten ways to combine fun and substance — From http://www.skylit.com/oop/FunAndSubstppt.pdf 10. Use gimmicks Provide a piece of Java code with a few syntax errors; finding and fixing these errors becomes an [...]
  • 2003: Array ideas — - The meaning of String[] args - Maybe some kind of game or the Caesar cipher. - Declaring, creating and using arrays - [...]
  • 2003: Slashdot Trolling Phenomena — Apparently, someone has written a fairly long description of common Slashdot trolls on WikiPedia#Slashdot_trolling_phenomena. Strange, strange.
  • 2003: SSH Tunnelling — Still no breakthrough. I’m trying to automatically set up SSH tunnels. Because sysads doesn’t like passphrases, I have to use expect [...]
  • 2003: Unofficial APT sources — http://www.apt-get.org

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging