浏览代码

Fix bug with mobile files

Pushing failed when `agenda-file' is in `org-agenda-text-search-extra-files'.
Carsten Dominik 15 年之前
父节点
当前提交
d02cde236c
共有 2 个文件被更改,包括 26 次插入13 次删除
  1. 6 0
      lisp/ChangeLog
  2. 20 13
      lisp/org-mobile.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-11-05  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-mobile.el (org-mobile-files-alist): Make it work when
+	`agenda-archives' is included in
+	`org-agenda-text-search-extra-files'.
+
 2009-11-05  John Wiegley  <jwiegley@gmail.com>
 
 	* org-clock.el (org-resolve-clocks-if-idle): Another fix to the

+ 20 - 13
lisp/org-mobile.el

@@ -177,19 +177,26 @@ using `rsync' or `scp'.")
 
 (defun org-mobile-files-alist ()
   "Expand the list in `org-mobile-files' to a list of existing files."
-  (let* ((files
-	  (apply 'append (mapcar
-			  (lambda (f)
-			    (cond
-			     ((eq f 'org-agenda-files) (org-agenda-files t))
-			     ((eq f 'org-agenda-text-search-extra-files)
-			      org-agenda-text-search-extra-files)
-			     ((and (stringp f) (file-directory-p f))
-			      (directory-files f 'full "\\.org\\'"))
-			     ((and (stringp f) (file-exists-p f))
-			      (list f))
-			     (t nil)))
-			  org-mobile-files)))
+  (let* ((include-archives
+	  (and (member 'org-agenda-text-search-extra-files org-mobile-files)
+	       (member 'agenda-archives	org-agenda-text-search-extra-files)))
+	 (files
+	  (apply 'append
+		 (mapcar
+		  (lambda (f)
+		    (cond
+		     ((eq f 'org-agenda-files) (org-agenda-files
+						t include-archives))
+		     ((eq f 'org-agenda-text-search-extra-files)
+		      (delq 'agenda-archives
+			    (copy-sequence
+			     org-agenda-text-search-extra-files)))
+		     ((and (stringp f) (file-directory-p f))
+		      (directory-files f 'full "\\.org\\'"))
+		     ((and (stringp f) (file-exists-p f))
+		      (list f))
+		     (t nil)))
+		  org-mobile-files)))
 	 (orgdir-uname (file-name-as-directory (file-truename org-directory)))
 	 (orgdir-re (concat "\\`" (regexp-quote orgdir-uname)))
 	 uname seen rtn file link-name)