Ashish Panigrahi

An upgraded workflow on reviewing finished tasks with org-agenda

In my last blogpost, I showcased how I review tasks finished over the last seven days. It implicitly assumes that I attend every group meeting[1] and that the group meeting happens during the same time every week[2].

In a more practical sense, it would be nice to generalize this workflow. I would like to specify a date, since when completed tasks would be displayed until the current day. This way I would be able to review my finished agenda items since a particular day in the past. This date would typically be when the group meeting last occured, but we are not strictly bound to it.

Implementation in emacs lisp

We write an elisp snippet similar to the one in the previous blogpost.

(defvar pani/last-group-meeting-date nil)

(setq org-agenda-custom-commands
      '(("v" "Finished tasks since last group meeting"
          tags
          (format "CLOSED>=\"<%s>\""
                  (setq pani/last-group-meeting-date
                        (org-read-date nil nil nil "Last group meeting: ")))
          ((org-agenda-overriding-header
            (format "Finished tasks since %s" pani/last-group-meeting-date))
           (org-agenda-archives-mode t)
           (org-agenda-tag-filter-preset '("-emacs" "-personal" "-email" "-misc"))
           (org-agenda-prefix-format '((tags . " ")))
           (org-agenda-remove-tags nil)))))

Most of the config options are similar so I won't be going over in detail. Let's instead point out the differences.

To invoke this view, we simply run M-x org-agenda and hit v to get into the view.

Invoking custom org-agenda views (slightly) faster

Just like in the previous workflow, we write another function to invoke this custom org-agenda view and bind it to C-c v to invoke it faster.

  (defun pani/done-items-since-meeting-org-agenda ()
    "Prompt for the date of the last group meeting and show completed tasks since then.
It displays every DONE item closed from the chosen day upto today."
    (interactive)
    (org-agenda nil "v"))

When invoking the view, we are prompted for a date with a pop-up calendar. We select a particular date in the past; Typing "-wed" to select last Wednesday, we are instantly greeted with the following view:

My custom org-agenda view

With this, we can review tasks not just from the last seven days, but basically from any day in the past!

  1. I wish I could wake up on time in the morning during winters!

  2. My supervisor is a busy person, which unfortunately requires the group meeting to be rescheduled sometimes, albeit infrequently.

#emacs #orgmode