posted by
emperor at 11:54am on 02/06/2004
I get a lot of spam. I generally eye-ball delete it. The problem is with so many duplicated addresses, that BBDB keeps asking me "change name SPAMMER1 to SPAMMER2? Keep SPAMMER1 as an aka?" I decided that the answer would be for BBDB to only be shown messages I decide to read, rather than all the ones I preview.
Unfortunately, there isn't a VM hook for paging a message that you'd previously previewed. After some discussion on the vm newsgroup, Kevin Rodgers suggested advising the show-current-message function such that it only called the bbdb-frobbing function if you were going from preview to show mode. That was half the story - I then had to advise the BBDB vm-insinuating function to remove the other call of that function (which gets added as a hook). The result is (in ~/.vm before the (bbdb-initialize 'vm)):
I've found it's stopped my BBDB growing full of throw-away addresses (it had got to 6MB), and speeds up deleting large piles of junk mail.
Unfortunately, there isn't a VM hook for paging a message that you'd previously previewed. After some discussion on the vm newsgroup, Kevin Rodgers suggested advising the show-current-message function such that it only called the bbdb-frobbing function if you were going from preview to show mode. That was half the story - I then had to advise the BBDB vm-insinuating function to remove the other call of that function (which gets added as a hook). The result is (in ~/.vm before the (bbdb-initialize 'vm)):
(defadvice vm-show-current-message (around pop-up-bbdb-buffer activate)
"Run `bbdb/vm-pop-up-bbdb-buffer' after showing a previewed message."
(let ((was-previewing (eq vm-system-state 'previewing)))
ad-do-it
(when (and was-previewing (eq vm-system-state 'showing))
(bbdb/vm-pop-up-bbdb-buffer))))
(defadvice bbdb-insinuate-vm (after kill-bbdb-vm-hooks activate)
"Remove the bbdb-added hooks from VM"
(cond ((boundp 'vm-select-message-hook) ; VM 5.36+
(remove-hook 'vm-select-message-hook 'bbdb/vm-pop-up-bbdb-buffer))
((boundp 'vm-show-message-hook) ; VM 5.32.L+
(remove-hook 'vm-show-message-hook 'bbdb/vm-pop-up-bbdb-buffer))
(t
(error "Old VM versions not supported by this advice..."))))
I've found it's stopped my BBDB growing full of throw-away addresses (it had got to 6MB), and speeds up deleting large piles of junk mail.