emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Autoarchiving done entries


From: Carsten Dominik
Subject: [Orgmode] Autoarchiving done entries
Date: Sun, 2 Sep 2007 09:30:56 +0200


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 <address@hidden>
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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]