emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: M <Elwood151@web.de>
Cc: emacs orgmode-mailinglist <emacs-orgmode@gnu.org>
Subject: Re: How can I calculate the "age" of a headline?
Date: Tue, 19 Aug 2014 11:41:19 -0400	[thread overview]
Message-ID: <m2ppfwtrkw.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <D019395F.1F15A%Elwood151@web.de> (M.'s message of "Tue, 19 Aug 2014 17:26:55 +0200")


I think this does what you want. I do not know if it would be easy to
get in a tabular agenda view though.

* Calculate age of this headline

#+BEGIN_SRC emacs-lisp
(org-narrow-to-subtree)
(org-time-stamp-to-now
 (car
  (cl-sort (org-element-map (org-element-parse-buffer) 'headline
	     (lambda (headline)
	       (org-element-property
		:raw-value
		(org-element-property :deadline headline))))
	   'org-time<)))
#+END_SRC

#+RESULTS:
: -14



** task 1
   DEADLINE: <2014-08-12 Tue>


** task 2
   DEADLINE: <2014-08-05 Tue>

M <Elwood151@web.de> writes:

> In my task lists, I'm working with scheduled and deadline dates.
> However, it would also often be very interesting, how "old" a task is, how
> long it is lurking around on my lists..
>
> Therefore it would be interesting to find the oldest timestamp below this
> heading and calculate the difference in days to today.
>
> Is that possible with org-mode already?
> Could I display this information in a tabular agenda view in a column?
>
> Kind regards
>
> Martin
>
>
>
>

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

  parent reply	other threads:[~2014-08-19 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 15:26 How can I calculate the "age" of a headline? M
2014-08-19 15:34 ` Thorsten Jolitz
2014-08-19 16:30   ` M
2014-08-19 17:50     ` Thorsten Jolitz
2014-08-19 15:41 ` John Kitchin [this message]
2014-08-19 21:30 ` Samuel Wales

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=m2ppfwtrkw.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=Elwood151@web.de \
    --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).