From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pedro Silva Subject: [PATCH] summarize timestamps in column view Date: Sun, 9 Jun 2013 01:01:11 +0100 Message-ID: <1370736071-1857-1-git-send-email-psilva+git@pedrosilva.pt> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlT4p-0000B7-RR for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 20:01:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlT4i-0001Et-OC for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 20:01:43 -0400 Received: from pedrosilva.pt ([178.79.155.209]:47185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlT4i-0001EM-Fv for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 20:01:36 -0400 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: emacs-orgmode@gnu.org Cc: Pedro Silva * org-colview.el (org-columns-compile-map): (org-columns-number-to-string): (org-columns-string-to-number): Handle timestamp summaries. * org.texi (Column attributes): Document timestamp summaries. TINYCHANGE --- contrib/lisp/org-colview-xemacs.el | 11 ++++++++++- doc/org.texi | 3 +++ lisp/org-colview.el | 11 ++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-colview-xemacs.el b/contrib/lisp/org-colview-xemacs.el index 63c0238..c2cff84 100644 --- a/contrib/lisp/org-colview-xemacs.el +++ b/contrib/lisp/org-colview-xemacs.el @@ -901,7 +901,12 @@ around it." ("@mean" mean_age (lambda (&rest x) (/ (apply '+ x) (float (length x)))) (lambda (x) (- org-columns-time x))) - ("est+" estimate org-estimate-combine)) + ("est+" estimate org-estimate-combine) + (" format,function,calc map. Used to compile/uncompile columns format and completing read in interactive function `org-columns-new'. @@ -1190,6 +1195,9 @@ Don't set this, this is meant for dynamic scoping.") (defun org-columns-number-to-string (n fmt &optional printf) "Convert a computed column number to a string value, according to FMT." (cond + ((memq fmt '(timestamp)) + (format-time-string + (or printf (car org-time-stamp-formats)) (seconds-to-time n))) ((memq fmt '(estimate)) (org-estimate-print n printf)) ((not (numberp n)) "") ((memq fmt '(add_times max_times min_times mean_times)) @@ -1218,6 +1226,7 @@ Don't set this, this is meant for dynamic scoping.") "Convert a column value to a number that can be used for column computing." (if s (cond + ((memq fmt '(timestamp)) s) ((memq fmt '(min_age max_age mean_age)) (cond ((string= s "") org-columns-time) ((string-match diff --git a/doc/org.texi b/doc/org.texi index 6d5eca0..8b1c49d 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -5497,6 +5497,9 @@ optional. The individual parts have the following meaning: @{@@min@} @r{Minimum age (in days/hours/mins/seconds).} @{@@max@} @r{Maximum age (in days/hours/mins/seconds).} @{@@mean@} @r{Arithmetic mean of ages (in days/hours/mins/seconds).} + @{ format,function,calc map. Used to compile/uncompile columns format and completing read in interactive function `org-columns-new'. @@ -1055,6 +1060,9 @@ Don't set this, this is meant for dynamic scoping.") (defun org-columns-number-to-string (n fmt &optional printf) "Convert a computed column number to a string value, according to FMT." (cond + ((memq fmt '(timestamp)) + (format-time-string + (or printf (car org-time-stamp-formats)) (seconds-to-time n))) ((memq fmt '(estimate)) (org-estimate-print n printf)) ((not (numberp n)) "") ((memq fmt '(add_times max_times min_times mean_times)) @@ -1083,6 +1091,7 @@ Don't set this, this is meant for dynamic scoping.") "Convert a column value to a number that can be used for column computing." (if s (cond + ((memq fmt '(timestamp)) s) ((memq fmt '(min_age max_age mean_age)) (cond ((string= s "") org-columns-time) ((string-match -- 1.8.3