6085 comments
2357 subscribers
6222 on Twitter
Subscribe! Feed reader E-mail

Emacs: Show only people whom I haven’t pinged since…

One of the things I want in a contact management system is a quick way
to find out who I haven’t pinged in a while. The following code
filters currently-displayed contacts to show who I might want to get
back in touch with. Call it from a *BBDB* window and specify the date
(could be 2006.01.01 for annual, -7 for the last seven days, etc.).
This works incredibly well with the following hacks:

I should write a small book about how to build a contact management
system with Emacs. ;) It’s insanely powerful, you know.

(require 'planner)
(require 'bbdb)
(defun sacha/bbdb-show-only-no-contact-since (date)
  "Show only people who haven't been pinged since DATE or at all."
  (interactive (list (planner-read-date)))
  (let ((records bbdb-records)
        new-records
        last-match
        omit
        notes)
    (while records
      ;; Find the latest date mentioned in the entry
      (setq notes (or (bbdb-record-notes (caar records)) ""))
      (setq last-match nil omit nil)
      (while (string-match
              "[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]"
              notes
              (or last-match 0))
        (unless (string> date (match-string 0 notes))
          (setq omit t)
          (setq last-match (length notes)))
        (setq last-match (match-end 0)))
      (unless (and last-match omit)
        (add-to-list 'new-records (caar records) t))
      (setq records (cdr records)))
    (bbdb-display-records new-records)))

One of the other things I’d like to smooth over is keeping track of
who owes whom e-mail… <laugh>

On Technorati: , , , , , ,

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

On This Day...

  • 2011: Getting better at working at the office — I’ll be working on a new project with a local coworker soon, which means I’ll probably come to the office [...]
  • 2010: Book: Getting to Yes — (c) 2010 David Prior – Creative Commons Attribution 2.0 Licence Getting to Yes: Negotiating Agreement Without Giving In Roger [...]
  • 2009: Weekly review: Sept 20 and Sept 27, 2009 — zomg, just realized I’d skipped the weekly review for last week. Hmm. Clearly, I need to sort out my task [...]
  • 2008: Learning sewing and French — Sewing is turning out to be surprisingly fun. I finished the wool jumper-dress (Simplicity 4097), learning how to work with [...]
  • 2007: The Kitten-ful Life — One of my friends has the absolutely best setup for kittendom. She fosters kittens for the Toronto Human Society, taking in [...]
  • 2007: When there’s more than one way to do things — Writing about Emacs turns out to be difficult. There are so many ways to do something. My goal for this book [...]
  • 2007: Work permit on its way — A CIC official called me two days ago to clarify something on my application for a post-graduate work permit. When we [...]
  • 2007: My SecondLife interviewbot is coming along nicely — I’d have given up on the Linden Scripting Language long ago if Stephen Perelgut hadn’t wanted this bot so much. It’s [...]
  • 2006: Conference Commando: Networking with Nametags — Whenever I go to a networking event and see people without nametags or with nametags that only have their first names, [...]
  • 2006: Emacs: Animation in presentations — … and because this is just so endearingly old-school and crazily Emacs, here’s what’s going to be my title “slide” for [...]
  • 2006: Emacs: BBDB rapid serial visualization — And because it’s good to quickly flash through records once in a while to refresh my memory… (defvar sacha/bbdb-rapid-serial-visualization-delay 1 "*Number of [...]
  • 2006: Emacs + LinkedIn: Another totally idiosyncratic bit of code — The following code should not be run until you’ve backed up your Big Brother Database and sacrificed a chicken. It goes [...]
  • 2005: On the Philippine Question — An excerpt from the speech of Senator George F. Hoar, in the Beveridge-Hoar Debate on the Philippine Question, delivered in the United [...]
  • 2005: Voice messaging network — Also via Social Software: Yackpack is a pretty social voice messaging thing. Web-based, so it doesn’t hurt to try it [...]
  • 2005: More collaborative software — Via Social Software: Gobby is a cross-platform collaborative editor. Finally!
  • 2005: Jotspot Live — Via TechCrunch: Jotspot Live now open. It’s a hosted wiki for simultaneous collaboration, with slick AJAX and great editing. Interesting…
  • 2005: Collaboration — Also via tech.memeorandum: Chris Pratley: Working as a team with a shared notebook Interesting support for collaboration…
  • 2005: Cognitive analysis of tagging — Rashmi Sinha: A cognitive analysis of tagging Yay! Another paper to add to my research question. Makes sense. Figuring out exactly where [...]
  • 2005: Learning changes — Via Weblogg-ed: Connecting for Life comes this blog post on Elearnspace: Connectivism, which points out that learning these days isn’t [...]
  • 2005: Forrester Consumer Forum report — The numbers are in. 10% of consumers read blogs at least once a week, 6% use RSS, and 4% use [...]
  • 2005: Solopreneurship and the Tipping Point — Small Business Branding: Content Management suggests a curriculum for the solopreneur. The stuff I’m interested in makes up for of [...]
  • 2005: Finding names: the 100th monkey — Charo inducted me into the 100th Monkey club. it’s something we talked about on mensaphilopen about how certain people, given the [...]
  • 2004: THE LAST PROMISE — “I’ll love you forever.” He pressed her fingers to his tear-stained cheeks. She pulled her hands away. “No more promises. That way, [...]
  • 2004: How to be a programmer — http://samizdat.mines.edu/howto/HowToBeAProgrammer.html Picked it up off my http://del.icio.us/inbox/sachac/ . Wonderful stuff. =)

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging