emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: M <Elwood151@web.de>
To: Thorsten Jolitz <tjolitz@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: How can I calculate the "age" of a headline?
Date: Tue, 19 Aug 2014 18:30:22 +0200	[thread overview]
Message-ID: <D019483E.1F168%Elwood151@web.de> (raw)
In-Reply-To: <87tx58ebni.fsf@gmail.com>

Thanks!
I'm using a setup based on Bert Hansen's, so I think I'm already using this
feature and a new headline looks like that:

** new headline
[2014-08-19 Di 18:28]

however, my question is how I can search for this timestamp (I'm not sure if
it is always at the same line below the headline, as sometimes there is a
logbook inbetween) and calculate the difference to today in days and then
display that as a separate column

Kind regards

Martin 


> Von: Thorsten Jolitz <tjolitz@gmail.com>
> Datum: Tue, 19 Aug 2014 17:34:25 +0200
> An: <emacs-orgmode@gnu.org>
> Betreff: Re: [O] How can I calculate the "age" of a headline?
> 
> 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..
> 
> I copied Bernt Hansens setup for toggling automatic insertion of
> inactive timestamps at headline creation. The tj/ prefix is there only
> for my convenience, it should really be bh/ (-> Bernt Hansen).
> 
> #+BEGIN_SRC emacs-lisp
> ;; *** Timestamps
> 
> ;; **** Configuration
> 
> (add-hook 'org-insert-heading-hook
>           'tj/insert-heading-inactive-timestamp 'append)
> 
> ;; **** Functions
> 
> (defvar tj/insert-inactive-timestamp t)
> 
> (defun tj/toggle-insert-inactive-timestamp ()
>   (interactive)
>   (setq tj/insert-inactive-timestamp
>         (not tj/insert-inactive-timestamp))
>   (message "Heading timestamps are %s"
>            (if tj/insert-inactive-timestamp "ON" "OFF")))
> 
> (defun tj/insert-inactive-timestamp ()
>   (interactive)
>   (org-insert-time-stamp nil t t nil nil nil))
> 
> (defun tj/insert-heading-inactive-timestamp ()
>   (save-excursion
>     (when tj/insert-inactive-timestamp
>       (org-return)
>       (org-cycle)
>       (tj/insert-inactive-timestamp))))
> #+END_SRC
> 
> -- 
> cheers,
> Thorsten
> 
> 

  reply	other threads:[~2014-08-19 16:30 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 [this message]
2014-08-19 17:50     ` Thorsten Jolitz
2014-08-19 15:41 ` John Kitchin
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=D019483E.1F168%Elwood151@web.de \
    --to=elwood151@web.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=tjolitz@gmail.com \
    /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).