From 0ac726a97e3c958596f534832b7676e7b11410a3 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Wed, 6 Feb 2013 08:34:10 +0100 Subject: [PATCH] Now catches mymail errors. --- mymail-vm.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mymail-vm.el b/mymail-vm.el index 7b2e6ea..07ed864 100644 --- a/mymail-vm.el +++ b/mymail-vm.el @@ -28,16 +28,25 @@ (let ((n 1) (mbox-name nil) - (args (mapconcat - (lambda (searche-request) - (if (not (string= searche-request "")) - (concat "-s " "\"" searche-request "\""))) - (split-string (concat param "," mymail/default-search-request) ",") - " "))) + (search-args + (apply 'nconc + (mapcar + (lambda (searche-request) + (if (not (string= searche-request "")) + (list "-s" searche-request))) + (split-string (concat param "," mymail/default-search-request) ",") + )))) (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) + (if (= (apply 'call-process + (nconc `("mymail" nil nil nil "--output" ,mbox-name) + search-args)) + 0) + (vm-visit-folder mbox-name t) + (message "mymail failed")) + + ;; (shell-command (concat "mymail --quiet --output " mbox-name " " args)) + ;; (vm-visit-folder mbox-name t) )) -- 2.39.5