In org-mode, I like to run org-todo-list, which displays the global todo list including all my org-agenda files. How do I view a TODO list for only the current buffer, ignoring my other org-agenda files?


You can use < from the agenda menu to restrict the current agenda call to the buffer that the agenda was invoked from. To restrict to that file for more than one call, you can use C-c C-x < (org-agenda-set-restriction-lock). See (info "(org) Agenda files") for more information.


You can use org-show-todo-tree to get a sparse tree view of the current buffer's TODO items. It's bound to C-c / t by default.

  • After that how can I expand only all TODOs? – alper Jun 1 '20 at 10:41

You could bind org-agenda-files dynamically to the current buffer's file and call org-todo-list from there:

(defun org-todo-list-current-file (&optional arg)
  "Like `org-todo-list', but using only the current buffer's file."
  (interactive "P")
  (let ((org-agenda-files (list (buffer-file-name (current-buffer)))))
    (if (null (car org-agenda-files))
        (error "%s is not visiting a file" (buffer-name (current-buffer)))
      (org-todo-list arg))))
  • I am having following message: Global list of TODO items of type: ALL Available with ‘N r’: (0)[ALL] – alper Jun 1 '20 at 10:42

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.