X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=mymail-vm.el;h=58bb76fd572d40539ab1e98e5b1cfc23b8b69fd1;hb=e2794d56046669841db12c418620a8fa062e13ad;hp=1795834c3ff26b3fcc6d55ef600f99499d57c689;hpb=11819e767975e5e98828e34f4b3130fd2ce50c57;p=mymail.git
diff --git a/mymail-vm.el b/mymail-vm.el
index 1795834..58bb76f 100644
--- a/mymail-vm.el
+++ b/mymail-vm.el
@@ -1,37 +1,36 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; This program is free software: you can redistribute it and/or modify ;;
-;; it under the terms of the version 3 of the GNU General Public License ;;
-;; as published by the Free Software Foundation. ;;
-;; ;;
-;; This program is distributed in the hope that it will be useful, but ;;
-;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
-;; General Public License for more details. ;;
-;; ;;
-;; You should have received a copy of the GNU General Public License ;;
-;; along with this program. If not, see . ;;
-;; ;;
-;; Written by and Copyright (C) Francois Fleuret ;;
-;; Contact for comments & bug reports ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; mymail-el
-
-(setq mymail-history-file ("~/.mymail-el-history"))
-
-;; (setq mymail-history '("p francois.fleuret,f 2013"))
+;; Copyright (c) 2013 Francois Fleuret
+;; Written by Francois Fleuret
+;;
+;; This file is part of mymail.
+;;
+;; mymail is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License version 3 as
+;; published by the Free Software Foundation.
+;;
+;; mymail is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with mymail. If not, see .
+
+(add-to-list 'recentf-exclude "/tmp/mymail-vm-.*\.mbox")
(defun mymail/vm-visit-folder (param)
-
- ;; (interactive "smymail search: ")
-
- (interactive (list (read-string "mymail search: " nil 'mymail-history)))
-
- (let ((args (mapconcat (lambda (x) (concat "-s " "\"" x "\""))
- (split-string param ",")
- " ")))
- (shell-command (concat "mymail " args " > /tmp/mymail.mbox"))
- )
- (vm-visit-folder "/tmp/mymail.mbox")
- )
+ (interactive
+ (list (read-string "mymail: " nil 'mymail-vm-history)))
+
+ (let ((n 1)
+ (mbox-name nil)
+ (args (mapconcat
+ (lambda (searche-request) (concat "-s " "\"" searche-request "\""))
+ (split-string param ",")
+ " ")))
+ (while (get-file-buffer (setq mbox-name (format "/tmp/mymail-vm-%d.mbox" n)))
+ (setq n (+ n 1)))
+
+ (shell-command (concat "mymail --quiet --output " mbox-name " " args))
+ (vm-visit-folder mbox-name t)
+ ))