|
|
Sponsor |
nnimap-folder-list-from-bbdb almost: msg#00006emacs.bbdb.user
Hello Some weeks ago I asked about a function which would generate a entry in the nnimap-split-fancy method. This entry would be based on a relevant entry in the bbdb entry, in this example imap. Now I digged out a function in google which almost does what I want. See below. However in generates a entry of the form (("From" "oub@mat\\.ucm\\.es" "testimap")) instead of ("From" "oub@mat\\.ucm\\.es" "testimap") I debugged the function and it seems the problem is (setq new-elmnt-list (cons (list Which seems to cause the (( Could anybody please give me a hint how to eliminate on of the parenthesis. Than I could just plug in that function into the gnus-splitting method, like nnimap-split-fancy '(| (: my:nnimap-folder-list-from-bbdb) Thanks Uwe Brauer Here comes the function. (defun my:nnimap-folder-list-from-bbdb () "Return a list of \(From email-regexp folder-name\) tuples based on the contents of the bbdb. The folder-name is the value of the 'imap attribute on the bbdb record; the email-regexp consists of all the email addresses for the bbdb record concatenated with with OR. bbdb records without a 'imap attribute are ignored. This function uses regexp-opt to generate the email-regexp which automatically regexp-quotes its arguments." ;(interactive) (let (;; the raw-notes attribute of a bbdb record notes-attr ;; the value of the 'imap attribute of a bbdb record folder-attr ;; strings to put before and after the folder-attr (folder-prefix "") (folder-postfix "") ;; a regexp matching all the email addresses from a bbdb record email-regexp ;; the list of (folder email) tuples to return new-elmnt-list ) ;; loop over the bbdb-records; if a imap attribute exists on ;; the record, generate a regexp matching all the email addresses ;; and add a tuple (folder email-regexp) to the new-elmnt-list (dolist (record (bbdb-records)) (setq notes-attr (bbdb-record-raw-notes record)) (when (and (listp notes-attr) (setq folder-attr (cdr (assq 'imap notes-attr)))) (setq email-regexp (regexp-opt (mapcar 'downcase (bbdb-record-net record)))) (unless (zerop (length email-regexp)) (setq new-elmnt-list (cons (list "From" email-regexp (concat folder-prefix folder-attr folder-postfix)) new-elmnt-list))))) new-elmnt-list)) ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ bbdb-info@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [bbdb/gnus] how to annotate with name of group, Robert Marshall |
|---|---|
| Next by Date: | Re: nnimap-folder-list-from-bbdb almost, Ronan Waide |
| Previous by Thread: | Re: [bbdb/gnus] how to annotate with name of group, Ronan Waide |
| Next by Thread: | Re: nnimap-folder-list-from-bbdb almost, Ronan Waide |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|