OK, I've finally upgraded to bbdb 2.32 because i need to get syncing
with my new palm working. Before I dump my .bbdb into my palm I want
to clean out all the junk in it. Basically, I've just been adding
records to it automatically for a long time. I now have over 5000
records; most of them junk.
So, for starters I wanted some programatic way to evaluate each record
and set the bbdb-record-set-deleted-p flag accordingly. Being pretty
new to lisp, I didn't know how to do that. What I tried was creating
a bbdb search results buffer (with an empty search string) and then
running this defun on that bbdb buffer:
(defun dka-prune-bbdb () (interactive)
(while (bbdb-next-record 1)
(or (bbdb-record-deleted-p)
(not (or (bbdb-record-firstname)
(bbdb-record-lastname)
(bbdb-record-aka)
(bbdb-record-phones)
(bbdb-record-addresses)
(assoc "posted-to" (bbdb-record-raw-notes))
(assoc "notes" (bbdb-record-raw-notes))
)
)
;; only get here if the record isn't marked for deletion
;; and there is no name, phone, or address or a posted-to
;; or 'notes' in the notes
(bbdb-record-set-deleted-p
(bbdb-delete-current-record)
)))
What it did was just move to the next record and stop. Of course, I
don't know why it didn't parse the whole buffer. Is this the best way
to do this? How do you guys keep your bbdb in check?
--
(__) Doug Alcorn (mailto:[EMAIL PROTECTED] http://www.lathi.net)
oo / PGP 02B3 1E26 BCF2 9AAF 93F1 61D7 450C B264 3E63 D543
|_/ If you're a capitalist and you have the best goods and they're
free, you don't have to proselytize, you just have to wait.
_______________________________________________
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/