emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stefan van der Walt <stefanv@berkeley.edu>
To: emacs-orgmode@gnu.org
Subject: DONE items skipped in org-map-entries
Date: Sat, 27 Aug 2016 15:49:42 -0700	[thread overview]
Message-ID: <1472338182.3937731.708026393.1463BA38@webmail.messagingengine.com> (raw)

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

             reply	other threads:[~2016-08-27 22:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27 22:49 Stefan van der Walt [this message]
2016-08-28 22:15 ` DONE items skipped in org-map-entries Nicolas Goaziou
2016-08-29 18:18   ` Stefan van der Walt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472338182.3937731.708026393.1463BA38@webmail.messagingengine.com \
    --to=stefanv@berkeley.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).