Skip to content

Commit

Permalink
Fix: :children todo
Browse files Browse the repository at this point in the history
Fixes #75.  Thanks to Ben Leggett (@bleggett) for reporting.
  • Loading branch information
alphapapa committed Jul 12, 2019
1 parent 360cb24 commit af3e625
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
3 changes: 2 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ These selectors take one argument alone, or multiple arguments in a list.

** 1.2-pre

Nothing yet.
*Fixed*
+ =:children todo= group selection ([[https://github.com/alphapapa/org-super-agenda/issues/75][#75]]). (Thanks to [[https://github.com/bleggett][Ben Leggett]].)

** 1.1.1

Expand Down
39 changes: 20 additions & 19 deletions org-super-agenda.el
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,26 @@ making it stretch across the screen."
(cl-defmacro org-super-agenda--map-children (&key form any)
"Return FORM mapped across child entries of entry at point, if it has any.
If ANY is non-nil, return as soon as FORM returns non-nil."
(declare (indent defun))
(org-with-gensyms (tree-start tree-end result all-results)
`(let ((,tree-start (point))
,tree-end ,all-results)
(when (org-goto-first-child)
(goto-char ,tree-start)
,(when any
`(save-excursion
(setq ,tree-end (org-end-of-subtree))))
(setq ,all-results (org-map-entries (lambda ()
(let ((,result ,form))
,(when any
`(when ,result
(setq org-map-continue-from ,tree-end)))
,result))
nil 'tree))
(if ,any
(--any (not (null it)) ,all-results)
,all-results)))))
(declare (indent defun)
(debug (":form" form [&optional ":any" sexp])))
(org-with-gensyms (tree-start result all-results region-beginning region-end)
`(save-excursion
(save-restriction
(let ((,tree-start (point))
,all-results)
(when (org-goto-first-child)
(narrow-to-region (point) (save-excursion
(goto-char ,tree-start)
(org-end-of-subtree)))
(goto-char (point-min))
(setq ,all-results
(cond (,any (cl-loop thereis ,form
while (outline-next-heading)))
(t (cl-loop collect ,form
while (outline-next-heading)))))
(if ,any
(--any (not (null it)) ,all-results)
,all-results)))))))

;;;; Support functions

Expand Down
23 changes: 13 additions & 10 deletions org-super-agenda.info
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,10 @@ File: README.info, Node: 12-pre, Next: 111, Up: Changelog
6.1 1.2-pre
===========

Nothing yet.
*Fixed*
• :children todo group selection (#75
(https://github.com/alphapapa/org-super-agenda/issues/75)).
(Thanks to Ben Leggett (https://github.com/bleggett).)


File: README.info, Node: 111, Next: 11, Prev: 12-pre, Up: Changelog
Expand Down Expand Up @@ -640,15 +643,15 @@ Node: Normal selectors12364
Node: Tips16995
Node: Changelog17846
Node: 12-pre18071
Node: 11118174
Node: 1118347
Node: 10319919
Node: 10220130
Node: 10120264
Node: 10020602
Node: Development20707
Node: Bugs21099
Node: Credits21738
Node: 11118337
Node: 1118510
Node: 10320082
Node: 10220293
Node: 10120427
Node: 10020765
Node: Development20870
Node: Bugs21262
Node: Credits21901

End Tag Table

Expand Down

0 comments on commit af3e625

Please sign in to comment.