1

Is there any way to move the cursor (point) to the first todo entry in my org file? Is there any built-in function in org-mode? if no, any elisp code that can do that is welcome.

I had tried this function:

org-show-todo-tree

This will only search(and unfold) for todo entries without pointing to the first todo item.

0

Here's one way:

(defun org-goto-first-todo ()
  "Jump to the first TODO entry in the buffer."
  (interactive)
  (goto-char (point-min))
  (outline-next-heading)
  (while (not (org-entry-is-todo-p))
    (forward-line 1)))
  • Thnak you, this works for me. So there is no a built-in org-mode function? – MedSaid Feb 8 at 23:42
  • Can you wrap your solution in an interactive command that can be bound to a key for clarity? – DoMiNeLa10 Feb 9 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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