emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* DONE items skipped in org-map-entries
@ 2016-08-27 22:49 Stefan van der Walt
  2016-08-28 22:15 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan van der Walt @ 2016-08-27 22:49 UTC (permalink / raw)
  To: emacs-orgmode

Dear org-mode developers,

For a while now, I've been using the solution to the following
StackOverflow question to archive all done subitems:

http://stackoverflow.com/a/27043756/214686

(I've repeated the question and answer below, for completeness.)

A few months ago, I noticed that the given solution no longer works.
Investigating (with org-mode/2016-08-22), it looks like org-map-entries
skips DONE items---likely different behavior from before.

The following test function can be used to replicate:

(defun org-count ()
  (interactive)
  (message "entries %d" (length
   (org-map-entries t t 'tree))))

Executing this function on any heading with the "DONE" tag returns 0.

Is this the correct behavior for org-map-entries?  If so, what do you
recommend as a better solution for archiving all done sub-items?

Thanks for your help,
Stéfan


StackOverflow Q: How do I archive all subitems?
A:

(defun org-archive-done-tasks ()
  (interactive)
  (org-map-entries
   (lambda ()
     (org-archive-subtree)
     (setq org-map-continue-from (outline-previous-heading)))
   "/DONE" 'tree))

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

* Re: DONE items skipped in org-map-entries
  2016-08-27 22:49 DONE items skipped in org-map-entries Stefan van der Walt
@ 2016-08-28 22:15 ` Nicolas Goaziou
  2016-08-29 18:18   ` Stefan van der Walt
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2016-08-28 22:15 UTC (permalink / raw)
  To: Stefan van der Walt; +Cc: emacs-orgmode

Hello,

Stefan van der Walt <stefanv@berkeley.edu> writes:

> For a while now, I've been using the solution to the following
> StackOverflow question to archive all done subitems:
>
> http://stackoverflow.com/a/27043756/214686
>
> (I've repeated the question and answer below, for completeness.)
>
> A few months ago, I noticed that the given solution no longer works.
> Investigating (with org-mode/2016-08-22), it looks like org-map-entries
> skips DONE items---likely different behavior from before.
>
> The following test function can be used to replicate:
>
> (defun org-count ()
>   (interactive)
>   (message "entries %d" (length
>    (org-map-entries t t 'tree))))
>
> Executing this function on any heading with the "DONE" tag returns 0.
>
> Is this the correct behavior for org-map-entries?

I'm not able to reproduce the issue. I tried with the following document

  ** DONE Foo
  *** Bar

with point anywhere on the first line, `org-count' displays "entries 2".


Regards,

-- 
Nicolas Goaziou

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

* Re: DONE items skipped in org-map-entries
  2016-08-28 22:15 ` Nicolas Goaziou
@ 2016-08-29 18:18   ` Stefan van der Walt
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan van der Walt @ 2016-08-29 18:18 UTC (permalink / raw)
  Cc: emacs-orgmode

Hi Nicolas

On Sun, Aug 28, 2016, at 15:15, Nicolas Goaziou wrote:
> I'm not able to reproduce the issue. I tried with the following document
> 
>   ** DONE Foo
>   *** Bar
> 
> with point anywhere on the first line, `org-count' displays "entries 2".

Thank you; your reply led me to inspect my emacsrc more closely.  The
following customization caused the problem:

(setq org-agenda-skip-function-global '(org-agenda-skip-entry-if 'todo
'done))

I didn't realize `org-map-entries` was tied to the agenda.

Best regards
Stéfan

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

end of thread, other threads:[~2016-08-29 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27 22:49 DONE items skipped in org-map-entries Stefan van der Walt
2016-08-28 22:15 ` Nicolas Goaziou
2016-08-29 18:18   ` Stefan van der Walt

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).