Prompt cosmetics.
[mymail.git] / mymail-vm.el
index f424c85..c2b96ae 100644 (file)
   :type 'string)
 
 (defun mymail/vm-visit-folder (param)
+  "Read a comma-separated list of search requests for mymail,
+create a temporary mbox with the resulting mails, and open it in
+vm with `vm-visit-folder'.
+
+The string `mymail/default-search-request' is automatically
+concatenated to the provided request, except if the request is
+prefaced with \\."
   (interactive
-   (list (read-string "mymail: " nil 'mymail-vm-history)))
+   (list (read-string "mymail-vm: " nil 'mymail-vm-history)))
 
   (let ((n 1)
         (mbox-name nil)
@@ -36,7 +43,9 @@
            (lambda (searche-request)
              (if (not (string= searche-request ""))
                  (list "-s" searche-request)))
-           (split-string (concat param "," mymail/default-search-request) ",")
+           (if (string= (substring param 0 1) "\\")
+               (split-string (substring param 1 nil))
+             (split-string (concat param "," mymail/default-search-request) ","))
            )))
 
         )
       (setq n (+ n 1)))
 
     (if (= (apply 'call-process
-                  (nconc (list "mymail" nil nil nil "--output" mbox-name)
+                  (nconc (list "mymail" nil nil nil
+                               "--output" mbox-name
+                               "--default-search" "p")
                          search-args))
-            0)
+           0)
         (vm-visit-folder mbox-name t)
       (message "mymail failed"))
   ))