johnsu01 (johnsu01) wrote,
johnsu01
johnsu01

  • Music:

Listing GTD contexts with Planner

This is just a quick hack to insert links at point in a planner buffer to all the planner pages whose names start with '@'. dydimustk on #emacs requested something like this, seems like it would be useful for the Getting Things Done types, since '@' is often used to signify a context like @Home or @Work. Automating it is a little more complicated. Maybe later.

(defun dyd/planner-list-contexts ()
  "Insert links at point for all planner pages whose names start with @."
  (interactive)
  (let* ((planner-list (muse-project-file-alist planner-project))
         (contexts 
          (delq nil 
                (mapcar
                 (lambda (page)
                   (if (string-match "^@" (car page)) (car page)))
                 planner-list))))
    (mapc
     (lambda (context)
       (insert (planner-make-link context) "\n"))
     contexts)))
Tags: emacs, gtd, lisp, muse, planner
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments