From 2ebf586e05e8e131c2e1c6ae8feb134d276633ce Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 5 Mar 2011 11:49:30 +0100 Subject: [PATCH] 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. --- lisp/org-mobile.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index c3d181d10..54717346e 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)