From: Ippei FURUHASHI <top.tuna+orgmode@gmail.com>
To: Brian van den Broek <brian.van.den.broek@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: defining a clocktable in a capture template with absolute timespan computed relative to today
Date: Fri, 27 Apr 2012 12:52:27 +0900 [thread overview]
Message-ID: <80haw595tc.fsf@gmail.com> (raw)
In-Reply-To: CAF6Daj+Mi2FzRkTTP9Pj-vdLd230bdW9o9spy-_t28YBN=3jQw@mail.gmail.com
Hi Brian,
Brian van den Broek <brian.van.den.broek@gmail.com> writes:
> how to add 1 day to the return value of (current-time).
This hard coding is out of org-mode range,
#+BEGIN_SRC elisp
(format-time-string "%Y-%m-%d" (time-add (current-time) (seconds-to-time (* 24 60 60))))
#+END_SRC
#+RESULTS:
: 2012-04-28
where the current-time is:
#+BEGIN_SRC elisp
(format-time-string "%Y-%m-%d" (current-time))
#+END_SRC
#+RESULTS:
: 2012-04-27
> I've been experimenting with a new means of using org to plan my day at
> the outset and, at the end of it, to easily review how close I have come
> to accomplishing what I planned.
I'm very interested. How do you compare your plan with results?
HTH,
IP
> Hi all,
>
> I've been experimenting with a new means of using org to plan my day at
> the outset and, at the end of it, to easily review how close I have come
> to accomplishing what I planned. For that second component, I want a
> clocktable covering the day to allow for an easy review of what I have
> accomplished. Since I am an extreme night-owl, I want the table to cover
> 8:00 of the day to 8:00 of the next one. (Things I do at 0:300 I think of as
> having been part of the previous day.) This is easy enough to accomplish
> manually. Today's, for instance, is defined as
> #+BEGIN: clocktable :maxlevel 4 :scope agenda :tstart "<2012-04-17
> 08:00>" :tend "<2012-04-18 Wed 08:00>" :fileskip0
>
> #+END:
>
> I've defined a capture template to produce, in a datetree, the
> boiler-plate for my daily planning and for the end of day review. As
> yet, the best I have managed for the clocktable is to include (some
> aspects omitted):
> #+BEGIN: clocktable :tstart \"<%(format-time-string \"%Y-%m-%d\"
> (current-time)) 08:00>\" :tend \"<%(format-time-string \"%Y-%m-%d\"
> (current-time)) 08:00>\" :fileskip0
>
> #+END:
>
> This still needs some fiddling to get the :tend parameter right as it
> defines it as exactly the same as the :tstart.
>
> What I need is something that fulfils the intent of
> :tend \"<%(format-time-string \"%Y-%m-%d\" (+ oneday
> (current-time))) 08:00>\".
> However, the docstring of (current-time) reads:
>
> Return the current time, as the number of seconds since 1970-01-01 00:00:00.
> The time is returned as a list of three integers. The first has the
> most significant 16 bits of the seconds, while the second has the
> least significant 16 bits. The third integer gives the microsecond
> count.
>
> My meagre elisp means that I will have to spend quite some time figuring
> out how to add 1 day to the return value of (current-time).
>
> So:
>
> 1) Is there an org-native way that I have overlooked to define a
> clock-table in a capture template that has the relative time-span that I
> desire?
>
> 2) If not, would someone please take pity on my poor elisp and give me
> the push to bring home my definition?
>
> Thanks and best,
>
> Brian vdB
>
> PS I suspect that this will wrap badly. Apologies if so; I hope the
> intent is nonetheless clear.
next prev parent reply other threads:[~2012-04-27 4:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 8:57 defining a clocktable in a capture template with absolute timespan computed relative to today Brian van den Broek
2012-04-27 3:52 ` Ippei FURUHASHI [this message]
2012-04-30 17:29 ` Brian van den Broek
2012-05-01 18:45 ` Ippei FURUHASHI
2012-05-02 21:44 ` Bernt Hansen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80haw595tc.fsf@gmail.com \
--to=top.tuna+orgmode@gmail.com \
--cc=brian.van.den.broek@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.