summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-03-05 11:49:30 +0100
committerBastien Guerry <bzg@altern.org>2011-03-05 11:49:30 +0100
commit2ebf586e05e8e131c2e1c6ae8feb134d276633ce (patch)
tree095a6f2608182f3db46c41b01c110457d35959bb
parent2d37c8caf5990e9d7ef7096cdac105710e9af328 (diff)
downloadorg-mode-2ebf586e05e8e131c2e1c6ae8feb134d276633ce.tar.gz
org-mobile.el: new custom variable org-mobile-files-exclude-regexp.
* org-mobile.el (org-mobile-files-exclude-regexp): New custom variable. (org-mobile-files-alist): Use it.
-rw-r--r--lisp/org-mobile.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index c3d181d..5471734 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -63,6 +63,11 @@ org-agenda-text-search-extra-files
(repeat :inline t :tag "Additional files"
(file))))
+(defcustom org-mobile-files-exclude-regexp ""
+ "A regexp to exclude files from `org-mobile-files'."
+ :group 'org-mobile
+ :type 'regexp)
+
(defcustom org-mobile-directory ""
"The WebDAV directory where the interaction with the mobile takes place."
:group 'org-mobile
@@ -241,7 +246,8 @@ using `rsync' or `scp'.")
(setq org-mobile-checksum-files nil))
(defun org-mobile-files-alist ()
- "Expand the list in `org-mobile-files' to a list of existing files."
+ "Expand the list in `org-mobile-files' to a list of existing files.
+Also exclude files matching `org-mobile-files-exclude-regexp'."
(let* ((include-archives
(and (member 'org-agenda-text-search-extra-files org-mobile-files)
(member 'agenda-archives org-agenda-text-search-extra-files)
@@ -263,6 +269,13 @@ using `rsync' or `scp'.")
(list f))
(t nil)))
org-mobile-files)))
+ (files (delete
+ nil
+ (mapcar (lambda (f)
+ (unless (and (not (string= org-mobile-files-exclude-regexp ""))
+ (string-match org-mobile-files-exclude-regexp f))
+ (identity f)))
+ files)))
(orgdir-uname (file-name-as-directory (file-truename org-directory)))
(orgdir-re (concat "\\`" (regexp-quote orgdir-uname)))
uname seen rtn file link-name)