all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bill Wishon <bill@wishon.org>
To: emacs-orgmode@gnu.org
Subject: Documentation vs. implementation for org-properties-postprocess-alist
Date: Sun, 22 Apr 2012 21:54:23 -0700	[thread overview]
Message-ID: <CAP2uJAveKGzjX=bX7nsdxjDH+K1_HU6HiKr0dcrWFjj_Q5FjGQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1596 bytes --]

             reply	other threads:[~2012-04-23  4:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  4:54 Bill Wishon [this message]
2012-04-29  9:43 ` Documentation vs. implementation for org-properties-postprocess-alist Bastien
2012-04-29 15:50   ` Bill Wishon
2012-04-29 16:07     ` Bastien

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP2uJAveKGzjX=bX7nsdxjDH+K1_HU6HiKr0dcrWFjj_Q5FjGQ@mail.gmail.com' \
    --to=bill@wishon.org \
    --cc=emacs-orgmode@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.