Re: gather from message send addresses
Randy Bush <[email protected]>
| Newsgroups | gmane.mail.wanderlust.general |
|---|---|
| Message-ID | <m2y42kyw2n.wl-randy__49857.6130871244$1474546329$gmane$org@psg.com> |
>> in bbdb2, i had >> >> ;; bbdb gather from message send addresses >> (defun zzz-bbdb-mail-send-function () >> (bbdb-update-records >> (delete-if (lambda (item) >> (string= "" (caaddr item))) >> (bbdb-wl-get-addresses bbdb-get-only-first-address-p)) >> t t)) >> (add-hook 'mail-send-hook 'zzz-bbdb-mail-send-function) > it grabs all addresses from the from and to headers of a freshly > composed email and puts them into bbdb? So if you send an email > to a new contact it's automatically inserted into bbdb, right? > > >> what is the bbdb3 equivalent? > I think you have to rewrite the b-wl-get-addr function. You will find > an example in bbdb-wl.el. I use this quite inelegant function: > > (defun hmw/wl-get-header(header) > > ; Depending on the hook this is used for there are different ways > ; to retrieve header data. > (let ((folder (if wl-summary-buffer-elmo-folder > wl-summary-buffer-elmo-folder > (wl-folder-get-elmo-folder wl-message-buffer-cur-folder))) > (msg-num (if wl-summary-buffer-elmo-folder > (wl-summary-message-number) > wl-message-buffer-cur-number))) > > (elmo-message-entity-field > (elmo-message-entity folder msg-num) > (intern (downcase header)) 'string))) > > The trouble is, that depending on the state of the process, i.e. what > hook is executed, you have to use different approaches to get the > headers from the mail buffer. I think the two approaches will not work > in a draft buffer, but you might get a feeling of what to do ;). > > Thinking about it for a bit longer, you might want to have a look at > the original b-wl-get-addr function and adjust that. At least the part > dealing with wl should still work. > > I'm sorry for this unhelpful mail, I'm a bit busy at the moment. If > you can't fix it and nobody else jumps in, post a reply and I will try > to look into that the upcoming weekend. i made no progress on this. weak fu and overwhelmed at work. have you made any? thanks randy