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