projects
/
mymail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8702faa
)
Update with groups for defcustom, cosmetics, and mymail/default-search-request.
author
Francois Fleuret
<francois@fleuret.org>
Sat, 23 Feb 2013 13:11:00 +0000
(14:11 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Sat, 23 Feb 2013 13:11:00 +0000
(14:11 +0100)
mymail-vm.el
patch
|
blob
|
history
diff --git
a/mymail-vm.el
b/mymail-vm.el
index
dc1976c
..
840bd93
100644
(file)
--- a/
mymail-vm.el
+++ b/
mymail-vm.el
@@
-16,23
+16,45
@@
;; You should have received a copy of the GNU General Public License
;; along with mymail. If not, see <http://www.gnu.org/licenses/>.
;; You should have received a copy of the GNU General Public License
;; along with mymail. If not, see <http://www.gnu.org/licenses/>.
-(add-to-list 'recentf-exclude "/tmp/mymail-vm-.*\.mbox")
+;; You may want to add
+;;
+;; (add-to-list 'recentf-exclude "/tmp/mymail-vm-.*\.mbox")
+;;
+;; to your .emacs
+
+(defgroup mymail ()
+ "Command to visit a folder build on-the-fly with mymail"
+ :version "0.9.5")
-(defcustom mymail/default-search-request ""
- "Default request to add to any search"
- :type 'string)
+(defcustom mymail/default-additional-search-requests ""
+ "Comma-separated list of search requests to add to any search"
+ :type 'string
+ :group 'mymail)
+
+(defcustom mymail/default-search-request nil
+ "Default request to use in place of the empty search"
+ :type 'string
+ :group 'mymail)
(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'.
(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
+If the request string is empty, use
+`mymail/default-search-request' instead.
+
+The string `mymail/default-additional-search-requests' is automatically
concatenated to the provided request, except if the request is
prefaced with \\."
(interactive
(list (read-string "mymail-vm: " nil 'mymail-vm-history)))
concatenated to the provided request, except if the request is
prefaced with \\."
(interactive
(list (read-string "mymail-vm: " nil 'mymail-vm-history)))
+ (if (string= param "")
+ (if mymail/default-search-request
+ (setq param mymail/default-search-request)
+ (error "mymail error: empty search")))
+
(let ((n 1)
(mbox-name nil)
(let ((n 1)
(mbox-name nil)
@@
-45,7
+67,7
@@
prefaced with \\."
(list "--search" searche-request)))
(if (string= (substring param 0 1) "\\")
(split-string (substring param 1 nil) ",")
(list "--search" searche-request)))
(if (string= (substring param 0 1) "\\")
(split-string (substring param 1 nil) ",")
- (split-string (concat param "," mymail/default-
search-request
) ","))
+ (split-string (concat param "," mymail/default-
additional-search-requests
) ","))
)))
)
)))
)