emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Documentation vs. implementation for org-properties-postprocess-alist
@ 2012-04-23  4:54 Bill Wishon
  2012-04-29  9:43 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Wishon @ 2012-04-23  4:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-29 16:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-23  4:54 Documentation vs. implementation for org-properties-postprocess-alist Bill Wishon
2012-04-29  9:43 ` Bastien
2012-04-29 15:50   ` Bill Wishon
2012-04-29 16:07     ` Bastien

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).