Skip to content

Commit

Permalink
Get the pull test to pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
danieroux committed Jan 16, 2016
1 parent 4fdeba5 commit 2e213f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions org-todotxt.el
Expand Up @@ -60,7 +60,7 @@
;; Sync

(defun org-todotxt-sync (todotxt-file)
"Pulls in any new tasks from TODOTXT-FILE into `org-todotxt-inbox-for-pull' and then pushes the result of `org-todotxt-create-agenda-function' into it.
"Pulls in any new tasks from TODOTXT-FILE into `org-todotxt-inbox-for-pull' and then overwrite it with the result of `org-todotxt-create-agenda-function'.
New tasks are defined as any task without an org-id marker."
(interactive)
Expand Down Expand Up @@ -160,12 +160,12 @@ Uses the Org tags associated with this task."

(defun org-todotxt-pull (from-todotxt-file)
(with-temp-buffer
(insert-file from-todotxt-file)
(goto-char 1))
(insert-file-contents-literally from-todotxt-file)
(goto-char 1)
(while (not (eobp))
(if (org-todotxt-pull--is-new-task-p)
(org-todotxt-pull--new-task-from-line))
(forward-line)))
(forward-line))))

;; auto-push

Expand Down
2 changes: 1 addition & 1 deletion test/org-todotxt-test.el
Expand Up @@ -85,7 +85,7 @@
(delete-file todotxt-file-test-pull-to-org-inbox))
(let ((org-todotxt-inbox-for-pull todotxt-file-test-pull-to-org-inbox))
(org-todotxt-pull todotxt-file-test-pull-from-todotxt)
(with-current-buffer (find-file-literally org-todotxt-inbox-for-pull)
(with-current-buffer (find-file-noselect org-todotxt-inbox-for-pull)
(goto-char 1)
(should (search-forward "* Brilliant todo PHB captures on mobile device" nil t))
(kill-buffer))))
Expand Down

0 comments on commit 2e213f0

Please sign in to comment.