Per-project org-agenda


For my personal projects I tend to keep a file where I write down project specific stuff. Adding each of those files to org-agenda-files would be tiresome plus I would see the information relating to every project each time I open the agenda. This would be a surefire way to get overwhelmed by the amount of information. Instead I use the following snippet to showing the project specific agenda when I'm inside a project that has a file.

  (defun my/org-agenda-list ()
    (cl-flet ((find-hacking-file ()
                              (let* ((tld (or (locate-dominating-file default-directory ".git/")
                                              (locate-dominating-file default-directory "")))
                                     (hacking-file (concat  default-directory "")))
                                (and (file-exists-p hacking-file)
      (let ((local-agenda-file (find-hacking-file)))
        (if local-agenda-file
            (let* ((lexical-binding nil)
                   (org-agenda-files (list local-agenda-file)))