From: Francois Fleuret Date: Tue, 5 Feb 2013 13:44:34 +0000 (+0100) Subject: Introduced mymail/default-search-request. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=98d120652fe86d6507579708ace19afb4b7feced;p=mymail.git Introduced mymail/default-search-request. --- diff --git a/mymail-vm.el b/mymail-vm.el index 58bb76f..7b2e6ea 100644 --- a/mymail-vm.el +++ b/mymail-vm.el @@ -18,6 +18,10 @@ (add-to-list 'recentf-exclude "/tmp/mymail-vm-.*\.mbox") +(defcustom mymail/default-search-request "" + "Default request to add to any search" + :type 'string) + (defun mymail/vm-visit-folder (param) (interactive (list (read-string "mymail: " nil 'mymail-vm-history))) @@ -25,9 +29,12 @@ (let ((n 1) (mbox-name nil) (args (mapconcat - (lambda (searche-request) (concat "-s " "\"" searche-request "\"")) - (split-string param ",") + (lambda (searche-request) + (if (not (string= searche-request "")) + (concat "-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)))