From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: How can I calculate the "age" of a headline? Date: Tue, 19 Aug 2014 14:30:33 -0700 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]:39897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJqzF-0004Xn-3H for emacs-orgmode@gnu.org; Tue, 19 Aug 2014 17:30:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJqzD-0004ZB-Ks for emacs-orgmode@gnu.org; Tue, 19 Aug 2014 17:30:36 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:50544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJqzD-0004VG-7O for emacs-orgmode@gnu.org; Tue, 19 Aug 2014 17:30:35 -0400 Received: by mail-wi0-f178.google.com with SMTP id hi2so5970918wib.11 for ; Tue, 19 Aug 2014 14:30:33 -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: M Cc: emacs orgmode-mailinglist i call these time spans. to me, it would be excellent as a custom timestamp format. this requires a patch to org at this location: Modified lisp/org.el diff --git a/lisp/org.el b/lisp/org.el index b1dc1ce..4497693 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16814,6 +16814,8 @@ The command returns the inserted time stamp." tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats) time (org-fix-decoded-time t1) str (org-add-props + ;; fixme alpha make it so that you can run a function + ;; (alpha-org-annotate-ts-with-time-span (format-time-string (substring tf 1 -1) (apply 'encode-time time)) nil 'mouse-face 'highlight) then the code for the time spans is as follows. (defun alpha-org-time-span-as-string (&optional from now) "Return the time span from now to the active or inactive Org timestamp at point, or nil. +1 means tomorrow. 0 means today. -1 means yesterday. from and now are daynums. " ;; (alpha-org-time-span from now) (let ((from (or from (alpha-org-daynum-from-ts-at-point))) (now (or now (alpha-org-daynum-from-now)))) (when (and from now) (alpha-org-format-time-span (- from now))))) (defun alpha-org-format-time-span (span) ;; + makes the numbers line up better ;; fixme emacs bug with 0 (format " = %+-3g" span)) ;; (format " [= %+-3g]" span)) (defun alpha-org-daynum-from-ts (ts) (time-to-days (org-time-string-to-time ts))) ;; (alpha-org-daynum-from-now) (defun alpha-org-daynum-from-now () (alpha-org-daynum-from-ts "")) (defun alpha-org-daynum-from-ts-at-point () ;; inactive too ;; (if ts ;; (alpha-org-daynum-from-ts ts) (when (org-at-timestamp-p t) (alpha-org-daynum-from-ts (substring (match-string 1) 0 10)))) On 8/19/14, M wrote: > 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 > > > > -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com The disease DOES progress. MANY people have died from it. And ANYBODY can get it. Denmark: free Karina Hansen NOW.