On Thursday, May 25, 2006 at 13:00:18, Uwe Brauer wrote: > Hello > > Does anybody know about a function which would insert a gcc field, > according to a relevant BBDB entry? > Example the entry > gnus-folder: nnimap+myserverimap.here.net:Gnus > would insert > Ccc: nnimap+myserverimap.here.net:Gnus > > I played a little around, but it seems not that trivial.
Why? Where does the relevant record come from? Look at: - bbdb-yank-addresses which will tell you how to get records from a BBDB buffer - bbdb-record-getprop is used to extract a field from a record - bbdb-complete-name-hooks / bbdb-mail-abbrev-expand-hook might be interesting in order to hook your magic - message-insert-to / message-carefully-insert-headers should be used for inserting The following defun is a start ... (defun bbdb-yank-ccc () (interactive) (let ((ccc (save-excursion (set-buffer bbdb-buffer-name) (and bbdb-records (car bbdb-records) (bbdb-record-getprop (caar bbdb-records) 'gnus-folder))))) (if ccc (message-carefully-insert-headers (list (cons 'Ccc ccc)))))) It is not that complicated, isn't? Robert ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ bbdb-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/