I'm new to emacs and org-mode and this seems like it should be easy but I haven't been able to find an answer.

Let's say I'm typing a todo list in ~/my_todo.org and i type up something like this:

* item 1
* item 2
** item 2.1
** item 2.2
* item 3

and now I want to make all of them TODOs. I could move the cursor on to each line and do C-c C-t but then I have to do that a bunch of times. Is there a way to select all of the lines and apply something like C-c C-t to each one to get something like

* TODO item 1
* TODO item 2
** TODO item 2.1
** TODO item 2.2
* TODO item 3

in one fell swoop?

  • did you try macros? F3 C-c C-t C-n F4, then C-u 5 F5.
    – Hellseher
    Commented Feb 1, 2018 at 21:42
  • Check out Magnar's multiple-cursors library and watch the Emacs Rocks video on that subject. It is a cannot-live-without library, in my opinion.
    – lawlist
    Commented Feb 2, 2018 at 1:04
  • @Hellseher Thank you, i was not familiar with emacs macros. That sounds very promising
    – alfalfa
    Commented Feb 2, 2018 at 2:49
  • @lawlist will do, thanks for the suggestion
    – alfalfa
    Commented Feb 2, 2018 at 2:49

1 Answer 1


You can achieve this, with a caveat, by defining your own org function. Something like so:

(defun my/mark-todo-in-region ()
  (let ((scope (if mark-active 'region 'tree))
        (state (org-fast-todo-selection)))
    (org-map-entries (lambda () (org-todo state)) nil scope)))

This has a few behaviors that are nice:

  1. It will prompt you for a TODO state to use, meaning it respects custom TODO keyword lists. (Also meaning you can mark the entire subtree with whatever state you're in the mood for.)
  2. If you select a region manually, everything in it gets marked with the TODO state you select.
  3. If you don't mark a region manually, it will operate on the subtree under point.

However: the caveat is, everything will be marked with the same keyword. This function is fairly naive -- pick one state, map entries, boom, done.

  • Thank you for this, I'll accept it as soon as I've had a chance to try it
    – alfalfa
    Commented Feb 5, 2018 at 14:45
  • unfortunately this doesn't always work for nested TODOs. I think the top-level one is attempted to be updated first but can't because of its subitems.
    – xeruf
    Commented Mar 30, 2021 at 18:13
  • fixed by letting (org-enforce-todo-dependencies nil) as well, see emacs.stackexchange.com/a/64212/30278
    – xeruf
    Commented Mar 30, 2021 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.