Jack Twilley writes:

> My bbdb has gotten unwieldy and ugly-looking, so I'd like to clean
> it.

> The most frustrating bit of ugliness involves the "newsgroups" field
> in my database.  My goal is to have a return-delimited sorted unique
> list of newsgroups for each poster in my database, but the real data
> looks ugly.  I wrote a perl function to fix this, but I can't just
> randomly apply it to my database because it'll mess up other fields.

Write something in Lisp.  This way, you can leverage off what bbdb
already has.  Something like this untested code:

(mapc '(lambda (rec)
         (let ((as (assoc 'newsgroups rec)))
           (when as
             (setcdr as (mapconcat 'identity
                                   (remove-duplicates (sort (split-string (cdr as)
                                                                          "[, \n]+")
                                                            string-lessp))
                                   "\n"))
             (bbdb-change-record rec nil))))
      (bbdb-records))

> Another bit of ugliness involves duplicate entries.  I have a few sets
> of duplicate entries for people who have dynamic email addresses.  Now
> that I have the ability to intelligently deal with those addresses as
> they arise, I need to deal with the ones that have since slipped
> through my fingers.  I don't want duplicate entries to be deleted,
> just flagged and displayed, so I can massage them by hand.

If you have a regexp for the network address of potential duplicate
entries, just run `M-x bbdb-net' with that regexp.

> It'd also be nice to say "display any entries that haven't come up in
> the past two years".  With all that done, my database would be trim
> and neat and probably a whole lot speedier.

This is hard.  Namely, what do you mean by "haven't come up recently"?
Doesn't the act of bringing up this list make them seen?

On the other hand, I remember someone posting a module that had a
'last-seen field, that only got filled in if it popped up because of
VM or Gnus.  This avoids the Heisenberg problem.

-- 
Colin

_______________________________________________
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to