(defun mymail/vm-visit-folder (param)
(interactive (list (read-string "mymail-vm search: " nil 'mymail-vm-history)))
- (let ((args (mapconcat (lambda (x) (concat "-s " "\"" x "\""))
+ (let ((n 1)
+ (mbox-name nil)
+ (args (mapconcat (lambda (x) (concat "-s " "\"" x "\""))
(split-string param ",")
" ")))
- (shell-command (concat "mymail " args " > /tmp/mymail.mbox"))
- )
- (vm-visit-folder "/tmp/mymail.mbox")
- )
+ (while (get-file-buffer (setq mbox-name (format "/tmp/mymail-vm-%d.mbox" n)))
+ (setq n (+ n 1)))
+
+ (shell-command (concat "mymail " args " > " mbox-name))
+ (vm-visit-folder mbox-name)
+ ))