Doing a get-new-mail in a virtual folder is switching the display to the underlying physical folder.
This didn't happen in 8.1.91a (which was withdrawn), but it is happening in 8.1.925a as well as the current trunk. By the point the control reaches the following backtrace, the display has been switched. The save-excursion in vm-virtual-get-new-mail doesn't help.
Debugger entered--returning value: "3588 messages, 17 new, 158 unread, 2 deleted"
vm-get-new-mail()
byte-code(...)
* vm-virtual-get-new-mail()
(cond ((eq major-mode ...) (vm-virtual-get-new-mail)) ((not ...) (error "Can't get mail for a non-VM folder buffer")) ((null arg) (if ... ...) (if ... ... ...) (let ... ...)) (t (let ... ... ... ... ... ...)))
* vm-get-new-mail(nil)
call-interactively(vm-get-new-mail nil nil)
Bug 614413 lists related issues.
Revision 760 of the 8.1.x branch extends vm-build- virtual- message- list to work with POP/IMAP folders. But this fix only works for creating new virtual folders. It is not working for incorporating new messages into them.