From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Autoarchiving done entries Date: Sun, 2 Sep 2007 09:30:56 +0200 Message-ID: Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IRjv9-0006wx-3a for emacs-orgmode@gnu.org; Sun, 02 Sep 2007 03:30:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IRjv8-0006wR-9d for emacs-orgmode@gnu.org; Sun, 02 Sep 2007 03:30:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IRjv8-0006wJ-1w for emacs-orgmode@gnu.org; Sun, 02 Sep 2007 03:30:58 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IRjv7-0003Wm-OC for emacs-orgmode@gnu.org; Sun, 02 Sep 2007 03:30:57 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list I got his message from John a few days ago - might be useful for some. And since I have not yet decided if and how I am going to include it, help yourself, for now. (message has been slightly edited by CD) Begin forwarded message: > From: John Wiegley > Date: August 31, 2007 5:04:49 CEST > I use something that I thought your users might find handy. It causes > all > completed todo items to be automatically flushed to the archive > whenever I > save my todo file. > > It consists of these settings: > > (setq safe-local-variable-values (quote ((after-save-hook > archive-done-tasks)))) > > (defun org-my-archive-done-tasks () > (interactive) > (save-excursion > (goto-char (point-min)) > (while (re-search-forward > (concat "\\* " (regexp-opt org-done-keywords) " ") nil t) > (goto-char (line-beginning-position)) > (org-archive-subtree)))) > > (defalias 'archive-done-tasks 'org-my-archive-done-tasks) > > After setting these, I add the following to the top of my todo file: > > MY TASKS -*- mode: org; fill-column: 78; after-save-hook: > (archive-done-tasks) -*- > > John > >