Michael Steiner | 1 Mar 2012 22:14
Picon

[mew-int 3049] Automatic case set & bbdb

Hi,

I have several accounts which i use with mew.  It would be nice if
selecting the correct case would be as automatic as possible.  I know
about mew-case-guess-alist but unless i'm overlooking something
trivial, it essentially has to be based on the To: and Cc: fields of
the new mail and hence more or less requires enumeration of ids if
there are no trivial rules based on domains. Hence that doesn't seem
that scalable.   However, to some extent i have the information
already in form of tags in a BBDB db which is linked to mew.

=>

Did anybody of you already implement some automatic case guessing
based on bbdb fields (maybe based on some bbdb-complete-name-hooks
trickery?) or alike and/or has a good idea how this could be
accomplished?

thanks!

-michael-


Michael Steiner | 1 Mar 2012 23:35
Picon

[mew-int 3050] Re: Automatic case set & bbdb

>>>>> On Thu, 01 Mar 2012 16:14:25 -0500 (EST), Michael Steiner <michisteiner <at> verizon.net> said:

   MS> I have several accounts which i use with mew.  It would be nice if
   MS> selecting the correct case would be as automatic as possible.  I know
   MS> about mew-case-guess-alist but unless i'm overlooking something
   MS> trivial, it essentially has to be based on the To: and Cc: fields of
   MS> the new mail and hence more or less requires enumeration of ids if
   MS> there are no trivial rules based on domains. Hence that doesn't seem
   MS> that scalable.   However, to some extent i have the information
   MS> already in form of tags in a BBDB db which is linked to mew.
   MS> 
   MS> =>
   MS> 
   MS> Did anybody of you already implement some automatic case guessing
   MS> based on bbdb fields (maybe based on some bbdb-complete-name-hooks
   MS> trickery?) or alike and/or has a good idea how this could be
   MS> accomplished?

Never mind. After digging a bit around in the code i came up with
following approach ....

	(add-hook
	 'bbdb-complete-name-hooks
	      '((lambda ()
		  (if (mew-draft-or-header-p) 
		      (let* ((rec (if (boundp 'match-recs) (car match-recs) rec))
			     (keywords (if rec (cdr (assoc 'keyword (bbdb-record-raw-notes rec))) ""))
			     (email    (if (boundp 'this-addr) this-addr "")))
			;(message (concat "k:" keywords " e:" email))
			(cond
(Continue reading)


Gmane