emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Emin.shopper Martinian.shopper" <emin.shopper@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: question about date-tree
Date: Sun, 25 Jul 2010 13:33:02 -0400	[thread overview]
Message-ID: <AANLkTimfgATtUX7o6yPQ1ngAJ2ZZK43Nts3XZnzEwPMH@mail.gmail.com> (raw)
In-Reply-To: <7F71C57E-8EB4-4D96-9AC4-17D8F27C423A@gmail.com>

Below is an elisp function which does the required work. I now call
this function at the beginning of the month so my journal.org file is
pre-populated to make it easier for me to set future todos. You can
also call it for any future month/year combination you want. Feel free
to add it to orgmode or just let people who want it add to their own
system manually.

Thanks again for orgmode!

;;;;; Elisp code follows:

(defun create-dates-for-month-and-year (month year)
  "Create entries in date-tree format in current buffer.

 This function creates nodes for all days in given the given MONTH and YEAR
 in the current buffer (if they do not exist already).

"
  (let ((day 1)
	(max-days (if (= 2 month)
			(if (date-leap-year-p year) 29 28)
		      (nth month
			   (list nil 31 28 31 30 31 30 31 31 30 31 30 31))))
	)
    (while (<= day max-days)
      (org-datetree-find-date-create (list month day year))
      (setq day (+ 1 day))
      )
    )
  )


On Tue, Jul 20, 2010 at 10:27 AM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
>
> On Jul 19, 2010, at 11:46 PM, Eric S Fraga wrote:
>
>> On Mon, 19 Jul 2010 08:10:49 -0400, "Emin.shopper Martinian.shopper"
>> <emin.shopper@gmail.com> wrote:
>>>
>>> Dear Experts,
>>>
>>> I really like the date-tree feature of org-remember and use it to plan
>>> my daily agenda. Often I want to plan things in the future and fill
>>> out an entry for a couple of weeks hence. It's slightly annoying to
>>> try to remember the day of week and date so that it will match the
>>> date-tree format.
>
>>>
>>> Is there a function/utility/suggestion for prepopulating a month's
>>> worth of date-tree daily nodes?
>>>
>>> Thanks,
>>> -Emin
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>> I know this doesn't actually answer your question but what I do is
>> simply bring up the agenda view and then insert an entry in the right
>> day using "i d".  This will create a date-tree entry if you've set the
>> right variable, specifically org-agenda-diary-file to point to the
>> date-tree file.
>
>
> Well,
>
> this is hard because org-capture places the entry *before* you
> get a chance to set those dates.
>
> - Carsten
>
>>
>> However, I also would like org-capture to handle this situation...
>> for instance, I would sometimes like todo entries that I define with
>> org-capture to be placed in a date tree structure for either of the
>> scheduled or deadline dates that todo entry is initially defined with.
>> --
>> Eric S Fraga
>> GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> - Carsten
>
>
>
>

      reply	other threads:[~2010-07-25 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 12:10 question about date-tree Emin.shopper Martinian.shopper
2010-07-19 21:46 ` Eric S Fraga
2010-07-20  1:09   ` org capture: use org-default-notes-file StephenL
2010-07-20  7:27     ` Carsten Dominik
2010-07-20 14:27   ` question about date-tree Carsten Dominik
2010-07-25 17:33     ` Emin.shopper Martinian.shopper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimfgATtUX7o6yPQ1ngAJ2ZZK43Nts3XZnzEwPMH@mail.gmail.com \
    --to=emin.shopper@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).