A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://lists.gnu.org/archive/html/emacs-orgmode/2009-07/msg00549.html below:

[Orgmode] [misc-new-features 1/5] Add two new special properties, SI

[Top][All Lists] [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Bastien Subject: Re: [Orgmode] [misc-new-features 1/5] Add two new special properties, SINCE and SINCE_IA. Date: Sat, 18 Jul 2009 11:35:48 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
Hi James, 

this small patch against current org-colview.el lets you have a custom
function for computing a "summary" of a property and displaying it in
the column.

To compute the time since the timestamp, you can use this patch and some
of your code like this:

--8<---------------cut here---------------start------------->8---
(setq org-columns-custom-summary-function 
      'my-org-compute-since)

(defun org-time-since (time)
  "Get the number of days since `time'"
  (time-to-number-of-days 
  (time-since (apply 'encode-time
                     (org-parse-time-string time)))))

(defun my-org-compute-since (&rest values)
  "Eval elapsted days since the entry's timestamp."
  (let* ((ts (org-entry-get (point) "TIMESTAMP")))
    (when ts (org-time-since ts))))
--8<---------------cut here---------------end--------------->8---

This patch is just a workaround, though.  I think we should have a way
of adding more than one custom function, as Mikael Fornius suggested
when sending his first patch.

Let's see what's Carsten take on this.

Thanks!

org-colview.el.patch
Description: Text Data

-- 
 Bastien

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4