2

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

1 Answer 1

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)))
2
  • Thnak you, this works for me. So there is no a built-in org-mode function?
    – MedSaid
    Commented Feb 8, 2019 at 23:42
  • Can you wrap your solution in an interactive command that can be bound to a key for clarity?
    – user12563
    Commented Feb 9, 2019 at 10:25

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.