Fix bugs in implementation and documentation of the mapping API.

There were bugs in the mapping API, pointed to by Samuel Wales:

    Manual says:

     The following example counts the number of entries with TODO keyword
     WAITING, in all agenda files.

        (length (org-map-entries t "/+WAITING" nil 'agenda))

    Org says invalid function for the string.

First of all, the example in the manual was wrong, the "nil" should be
gone.  Second, the mapping function did not return all results in a
list, so that `length' could not count them.

This patch fixes these issues.
This commit is contained in:
Carsten Dominik 2008-12-02 16:53:25 +01:00
parent 269c5a85bc
commit 4800fd8b7c
4 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2008-12-02 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Using the mapping API): Fix bug in mapping example.
2008-11-29 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Property searches): Document new special values for

View File

@ -9830,7 +9830,7 @@ The following example counts the number of entries with TODO keyword
@code{WAITING}, in all agenda files.
@lisp
(length (org-map-entries t "/+WAITING" nil 'agenda))
(length (org-map-entries t "/+WAITING" 'agenda))
@end lisp
@node History and Acknowledgments, Main Index, Hacking, Top

View File

@ -1,3 +1,7 @@
2008-12-02 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-map-entries): Return all values.
2008-11-29 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-matcher-time): Recognize more special values.

View File

@ -9897,7 +9897,7 @@ the scanner. The following items can be given here:
(org-agenda-skip-function
(car (org-delete-all '(comment archive) skip)))
(org-tags-match-list-sublevels t)
matcher pos file
matcher pos file res
org-todo-keywords-for-agenda
org-done-keywords-for-agenda
org-todo-keyword-alist-for-agenda
@ -9906,7 +9906,7 @@ the scanner. The following items can be given here:
(cond
((eq match t) (setq matcher t))
((eq match nil) (setq matcher t))
(t (setq matcher (if match (org-make-tags-matcher match) t))))
(t (setq matcher (if match (cdr (org-make-tags-matcher match)) t))))
(when (eq scope 'tree)
(org-back-to-heading t)
@ -9939,7 +9939,8 @@ the scanner. The following items can be given here:
(save-restriction
(widen)
(goto-char (point-min))
(org-scan-tags func matcher))))))))
(setq res (append res (org-scan-tags func matcher)))))))
res)))
;;;; Properties