From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Wishon Subject: Documentation vs. implementation for org-properties-postprocess-alist Date: Sun, 22 Apr 2012 21:54:23 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9399dd796a00404be516e23 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMBID-0000xK-TP for emacs-orgmode@gnu.org; Mon, 23 Apr 2012 00:54:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMBIB-00005f-0e for emacs-orgmode@gnu.org; Mon, 23 Apr 2012 00:54:29 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:41706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMBIA-00004z-Rt for emacs-orgmode@gnu.org; Mon, 23 Apr 2012 00:54:26 -0400 Received: by iajr24 with SMTP id r24so20072137iaj.0 for ; Sun, 22 Apr 2012 21:54:23 -0700 (PDT) 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 --14dae9399dd796a00404be516e23 Content-Type: text/plain; charset=ISO-8859-1 Hi, While hacking around I read the doc for org-properties-postprocess-alist and I think it doesn't align with what the implementation of org-set-property does. The example in the docstring says: (("Remaining" (lambda(value) (let ((clocksum (org-clock-sum-current-item)) (effort (org-duration-string-to-minutes (org-entry-get (point) "Effort")))) (org-minutes-to-hh:mm-string (- effort clocksum)))))) But in order for this to work with the implementation I think it would need to be : (("Remaining" ((lambda(value) (let ((clocksum (org-clock-sum-current-item)) (effort (org-duration-string-to-minutes (org-entry-get (point) "Effort")))) (org-minutes-to-hh:mm-string (- effort clocksum))))))) Adding extra parens around the lambda expression in the example to make it a list. Either that or the implementation of org-set-property should change to : $ diff org.el org.el.new 14593c14593 < (fn (assoc property org-properties-postprocess-alist))) --- > (fn (cdr (assoc property org-properties-postprocess-alist)))) 14596c14596 < (when fn (setq value (funcall (cadr fn) value))) --- > (when fn (setq value (funcall fn value))) What do you think? ~>Bill --14dae9399dd796a00404be516e23 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

While hacking around I read the doc for org-properties-postproce= ss-alist and I think it doesn't align with what the implementation of o= rg-set-property does.

The example in the docstring says:

=A0= =A0=A0 (("Remaining" (lambda(value)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (let ((cloc= ksum (org-clock-sum-current-item))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (effort (org-duration-string-= to-minutes
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-entry-get (point) = "Effort"))))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-= minutes-to-hh:mm-string (- effort clocksum))))))

But in order for th= is to work with the implementation I think it would need to be :

=A0= =A0=A0 (("Remaining" ((lambda(value)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (let ((cloc= ksum (org-clock-sum-current-item))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 (effort (org-duration-string-to-minutes
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-entry-get (point) "Effort&qu= ot;))))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (org-= minutes-to-hh:mm-string (- effort clocksum)))))))

Adding extra paren= s around the lambda expression in the example to make it a list.=A0 Either = that or the implementation of org-set-property should change to :

$ diff org.el org.el.new
14593c14593
<=A0=A0=A0=A0=A0=A0=A0 (f= n (assoc property org-properties-postprocess-alist)))
---
>=A0=A0= =A0=A0=A0=A0=A0 (fn (cdr (assoc property org-properties-postprocess-alist))= ))
14596c14596
<=A0=A0=A0=A0 (when fn (setq value (funcall (cadr f= n) value)))
---
>=A0=A0=A0=A0 (when fn (setq value (funcall fn value)))

Wh= at do you think?

~>Bill
--14dae9399dd796a00404be516e23--