Next: , Previous: Contact procedures and objects, Up: Contacts   [Contents]


4.2 All contacts

Sometimes you may want to inspect all the different contacts in the mu database. This is useful, for instance, when exporting contacts to some external format that can then be important in an e-mail program.

To enable this, there is the procedure mu:for-each-contact, defined as

(mu:for-each-contact procedure [search-expression]).

This will aggregate the unique contacts from all messages matching <search-expression> (when it is left empty, it will match all messages in the database), and execute procedure for each of them.

The procedure receives an object of the type <mu:contact-with-stats>, which is a subclass of the <mu:contact> class discussed in See Contact procedures and objects. <mu:contact-with-stats> objects expose the following additional methods:

The method assumes an e-mail address is unique for a certain contact; if a certain e-mail address occurs with different names, it uses the most recent non-empty name.