diff --git a/README.org b/README.org index f1c4d3d..b522f3d 100644 --- a/README.org +++ b/README.org @@ -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 diff --git a/org-super-agenda.el b/org-super-agenda.el index 006ee67..5812597 100644 --- a/org-super-agenda.el +++ b/org-super-agenda.el @@ -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 diff --git a/org-super-agenda.info b/org-super-agenda.info index 399c45a..4392cfc 100644 --- a/org-super-agenda.info +++ b/org-super-agenda.info @@ -491,7 +491,10 @@ File: README.info, Node: 12-pre, Next: 11, 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: 11, Next: 103, Prev: 12-pre, Up: Changelog @@ -629,14 +632,14 @@ Node: Normal selectors12349 Node: Tips16980 Node: Changelog17831 Node: 12-pre18041 -Node: 1118143 -Node: 10319718 -Node: 10219929 -Node: 10120063 -Node: 10020401 -Node: Development20506 -Node: Bugs20898 -Node: Credits21537 +Node: 1118306 +Node: 10319881 +Node: 10220092 +Node: 10120226 +Node: 10020564 +Node: Development20669 +Node: Bugs21061 +Node: Credits21700  End Tag Table