2 ;; Copyright (c) 2013 Francois Fleuret
3 ;; Written by Francois Fleuret <francois@fleuret.org>
5 ;; This file is part of mymail.
7 ;; mymail is free software: you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License version 3 as
9 ;; published by the Free Software Foundation.
11 ;; mymail is distributed in the hope that it will be useful, but
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;; General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with mymail. If not, see <http://www.gnu.org/licenses/>.
19 (add-to-list 'recentf-exclude "/tmp/mymail-vm-.*\.mbox")
21 (defcustom mymail/default-search-request ""
22 "Default request to add to any search"
25 (defun mymail/vm-visit-folder (param)
27 (list (read-string "mymail: " nil 'mymail-vm-history)))
34 (lambda (searche-request)
35 (if (not (string= searche-request ""))
36 (list "-s" searche-request)))
37 (split-string (concat param "," mymail/default-search-request) ",")
40 (while (get-file-buffer (setq mbox-name (format "/tmp/mymail-vm-%d.mbox" n)))
43 (if (= (apply 'call-process
44 (nconc `("mymail" nil nil nil "--output" ,mbox-name)
47 (vm-visit-folder mbox-name t)
48 (message "mymail failed"))
50 ;; (shell-command (concat "mymail --quiet --output " mbox-name " " args))
51 ;; (vm-visit-folder mbox-name t)