I make a function that move from TODO state to DONE and archive it in the archives files, and I set org-mode-map to make this function by a keybinding, but in agenda it doesn't change the TODO state. I tried to find a org-agenda-mode-map or something similar but I can't find it. My function is:
(defun mark-done-and-archive () (interactive) (org-todo 'done) (org-archive-subtree)) (define-key org-mode-map "\C-c\C-x\C-s" 'mark-done-and-archive) EDIT
So when in my TODOS.org file I hit C-c C-x C-s the todo automatically is marked as DONE and move from TODOS.org to archive.org but when I make this in org-agenda buffer the todo is moved from his file well, the only problem is that it isn't marked as done. As example:
Archive todos.org
* TODO one todo from todo.org * TODO Another todo
So I open todos.org and complete the first todo so I hit C-c C-x C-s and the file todos.org now contains:
* TODO Another todo
and archive.org contains: DONE one todo from todo.org
But when I show my org-agenda and * TODO Another todo it's show, I try to complete and move to my archive file, again with C-c C-x C-s but I obtain the following in archive.org:
* DONE one todo from todo.org * TODO Another todo
and todos.org it's empty.