From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: Org-mode Habit with Varying Description Date: Tue, 21 Oct 2014 17:37:54 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgbVY-0005Ep-F7 for emacs-orgmode@gnu.org; Tue, 21 Oct 2014 11:38:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgbVT-0001B5-Kj for emacs-orgmode@gnu.org; Tue, 21 Oct 2014 11:38:00 -0400 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]:40223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgbVT-0001Ap-HK for emacs-orgmode@gnu.org; Tue, 21 Oct 2014 11:37:55 -0400 Received: by mail-qg0-f54.google.com with SMTP id z107so1060320qgd.13 for ; Tue, 21 Oct 2014 08:37:54 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Daya Atapattu Cc: Org Mode Hi Daya On Mon, Oct 20, 2014 at 4:33 PM, Daya Atapattu wrote: > I like to schedule studying a book: It would be scheduled as "Read pages > 100-125." Then the next day it should read "Read pages 126-150." The > description of the habit varies; org-mode picks that up sequentially from a > list. Once I was using this simple solution for a continuous burn down task, adapted to your example: * Burn down %%(when (and (not (org-date 2014 10 20)) (calendar-date-equal date (calendar-current-date))) (message "Read book until page %d 19:00" (* 25 (- (calendar-absolute-from-gregorian date) (calendar-absolute-from-gregorian '(10 15 2014)))))) Note that "%%(" has to start on the first column and that the rest could be moved partially or as a whole into a function call for easier maintenance. "19:00" is an optional time of day. "2014 10 20" (YYYY MM DD) is a poor man's DONE (which I use mainly for diary-float) and has to be set manually to today after the part of today has been done to let the task disappear from the agenda view of today. "10 15 2014" (MM DD YYYY) is the start date. Can also be used as an end date for a countdown by swapping the subtraction operands. calendar-date-equal is used to show it only for the day of today in an agenda view showing also tomorrow etc. Instead of using the number to print with %d it can easily be used to do a lookup in a variable containing a list of whatever which can not be computed directly like e. g. the headings of the book chapters. Inspired by Worg "Add sunrise/sunset times to the agenda", currently http://orgmode.org/worg/org-hacks.html#sec-2-10 Michael