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."
   (delq nil
          (lambda (rec) (and (bbdb-record-addresses rec) rec))
   (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: ,