6194 comments
2357 subscribers
Follow me on Twitter (@sachac)
Subscribe! Feed reader E-mail

Emacs hacks: Snail mail surprise

I like sending snail mail. This Emacs Lisp snippet displays all the
contacts for whom I have addresses, sorted according to country. This
makes it easy for me to, say, jump to all the USA contacts whom I
should mail before heading back over the border.

(defun sacha/bbdb-filter-records-for-address (records)
  "Filter records for addresses."
  (sort
   (delq nil
         (mapcar
          (lambda (rec) (and (bbdb-record-addresses rec) rec))
          records))
   (lambda (a b)
     (string< (bbdb-address-country (car (bbdb-record-addresses a)))
              (bbdb-address-country (car (bbdb-record-addresses b)))))))

;; Do the actual work here
(bbdb-display-records (sacha/bbdb-filter-records-for-address (bbdb-records)))

On Technorati: ,

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

On This Day...

  • 2012: Thinking about ways to help people who are in between — A number of people I know are in transition, looking for their next job. Some people are giving the independent [...]
  • 2011: Session follow-up #1: Discovering Yourself through Blogging — I enjoyed chatting with Holly Tse about blogging and how it can help you learn more about life, connect with [...]
  • 2010: Note-taking revisited — I was away for training last week, attending a 3-day learning session organized by IBM. There were around 500 IBMers [...]
  • 2009: Teaching energy — Maybe it is possible to teach energy, because I can certainly point to some teachers who influenced me–all the way [...]
  • 2009: Notes from my staycation — We spent an industrious day preparing apricot syrup and jalapeño jelly, packaging fourteen jars of each. I did some calculations [...]
  • 2007: Fishing random things out of my head — I’m getting better at fishing random things out of my head. I remember names more easily now. Last week, someone asked [...]
  • 2007: Brrr — It’s mid-August, and a cold front is passing through Toronto. My toes feel chilly under this blanket. Even though sunlight illuminates [...]
  • 2006: Mission successful! — Met lots of interesting people and learned about all sorts of cool projects. =) Can’t blog about it externally, but will [...]
  • 2006: Waking up to a glorious morning — I *love* having a huge window with lots of sunlight in the morning. I woke up this morning to brilliant sunlight, [...]
  • 2006: All’s well — I woke up at 1:15 to the sound of the fire alarm blaring. Stumbling blearily out of bed, I grabbed a [...]
  • 2005: Trudging home with groceries — I bought four whole frozen chickens today, taking advantage of a promo at Price Chopper to stock up on ingredients for [...]
  • 2005: Red Flag Deals: Great articles — Check out Red Flag Deals for great promos in Toronto. The articles are also immensely useful. On Technorati: canada
  • 2004: Travel plans — Going to Hong Kong to look for business suits and winter clothes. Will be there until Friday. Then back here for the [...]
  • 2004: Firespinning pictures — From Joe Gene: Here are some pictures I took from Monday evening’s show. http://pictures.apc.edu.ph/view_album.php?set_albumName=firedancing E-Mail from Jose Quesada
  • 2002: Religion, friendship, whatever — Today I had a rather deep discussion with Paolo Venegas about – of all things – religion, or my lack thereof. On [...]