christopherjwhite / org-toodledo

Emacs enhancement for syncing org-mode tasks with Toodledlo
83 stars 16 forks source link

How to archive deleted tasks. #17

Closed lawlist closed 10 years ago

lawlist commented 11 years ago

I found this nice function that archives a done task, and I'm wondering if there is any way to modify org-toodledo-mark-task-deleted so that the task gets deleted and archived all in one fell swoop?

(defun my-org-archive-done-tasks () (interactive) (org-map-entries 'org-archive-subtree "/DONE" 'file))

christopherjwhite commented 11 years ago

This is a good idea - let me take a look at it this weekend.

lawlist commented 10 years ago

Thank you for adding support for archiving completed tasks -- greatly appreciate ! :)

christopherjwhite commented 10 years ago

FYI -- this only archives deleted tasks, not completed tasks... I've got most of the code written for archiving completed tasks, just testing it out, so stay tuned!

christopherjwhite commented 10 years ago

Ok -- just pushed version 2.13 which now supports archiving completed tasks. You'll need to set org-toodledo-archive-completed-tasks to t, as it defaults to nil. This is designed to work whether you complete tasks in org or on Toodledo -- at sync time, the tasks are synced and then archived.

lawlist commented 10 years ago

Thank you very much. I'll give it whirl in the next few days. I manually modify several portions of the source for a variety of reasons, and need to diff each new release and incorporate my personal modifications before being able to try it out on my master calendar database. The modified version I am using is more in line with the actual Toodledo options that are available -- i.e., Next Action, Active, Delegated; and, all of the Toodledo priorities as well.

christopherjwhite commented 10 years ago

Let me know if you have any changes that you might like to merge back into the main project and I'll take a look...

On 9/2/13 7:04 PM, lawlist wrote:

Thank you very much. I'll give it whirl in the next few days. I manually modify several portions of the source for a variety of reasons, and need to diff each new release and incorporate my personal modifications before being able to try it out on my master calendar database. The modified version I am using is more in line with the actual Toodledo options that are available -- i.e., Next Action, Active, Delegated; and, all of the Toodledo priorities as well.

— Reply to this email directly or view it on GitHub https://github.com/christopherjwhite/org-toodledo/issues/17#issuecomment-23682523.

lawlist commented 10 years ago

Deleting / archiving uses an internet connection to communicate with Toodledo servers before synchronizing. Is there any way to delete / archive tasks (off-line) without communicating with Toodledo, and then have the deletions take effect only when synchronizing?

christopherjwhite commented 10 years ago

Yeah -- this is a tough one. It has to parse the current task in org-mode in order to delete it, and parsing it requires the folder name to id map, context name to id map, etc. These maps are built on demand by contacting the server to get the latest values. So, the calls to the Toodledo servers should only occur the first time you do something after opening your todo org-mode file. That will download and cache the values in memory. Subsequent deletes should not issue a call.

I definitely see the need here, but it's going to take a bit more effort to get that done....

...cj

On 9/16/13 1:41 PM, lawlist wrote:

Deleting / archiving uses an internet connection to communicate with Toodledo servers |before| synchronizing. Is there any way to delete / archive tasks |without| communicating with Toodledo, and then have the deletions take effect |only| when synchronizing?

— Reply to this email directly or view it on GitHub https://github.com/christopherjwhite/org-toodledo/issues/17#issuecomment-24529039.

lawlist commented 10 years ago

Thank you for helping me to understand how that function works. In the meantime -- instead of deleting / archiving immediately -- I will set the status to None with a -1 Negative priority and refile the completed tasks to a section at the bottom of my org file called * COMPLETED with :ToodledoFolder: COMPLETED. Then, whenever I have a strong internet connection, I can archive / delete the tasks that were previously completed. Perhaps that is a possible workaround for the need of an internet connection -- i.e., on synchronization, tasks with a status of None and a -1 Negative priority to be archived and deleted IF the user has chosen that option -- e.g., (setq delete-archive-completed-on-sync t) -- the function occurring after newly completed tasks on Toodledo are synchronized to the org file so they in turn also get archived / deleted.

EDIT: I see that you recently implemented something similar (although without deleting from the Toodledo server) -- org-toodledo-archive-completed-tasks. I just updated my org-toodledo.el (with some custom modifications) and I will try out the new feature.