I've started using Org contacts, and find it very useful, especially as
an address book for Gnus.  I had to make some modifications to make the
library function as I wanted.  I am posting them here just in case they
are of interest to others.

1. Put quotes around names with periods in email addresses.

(defadvice org-contacts-format-name (after my-quote-name activate)
  "Put quotes around display names with periods in email addresses.
This is required by RFC 822, but not by RFC 2822 (see the
discussion on obs-phrase in the latter).  This advice takes a
conservative approach."
  (when (memq ?. (string-to-list ad-return-value))
    (setq ad-return-value (format "\"%s\"" ad-return-value))))

2. Don't add links from contacts to last-read messages unless asked.

(defvar my-contacts-link-last-mail nil
  "If non-nil, store last-read-mail links in Org contacts.")

(defadvice org-contacts-gnus-store-last-mail
  (around my-contacts-link-last-mail-ad activate)
  "Link to last-read mail in contacts per `my-contacts-link-last-mail'."
  (when my-contacts-link-last-mail
    ad-do-it))

3. I was surprised to find that the lib was making an HTTP request each
time I did "M-x org-contacts".  This fixed it:

;; Don't fetch "avatar" icons of contacts from the Web.
(setq org-contacts-icon-use-gravatar nil)

I wonder if it is a good idea to make (1) and (2) the default behaviour.

Thanks and best regards,
Raghavendra.

-- 
N. Raghavendra <ra...@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/


Reply via email to