          (helm-candidates (helm-get-org-candidates-in-file org-filepath 0 1)))
     (ar/format-helm-candidates helm-candidates)))
 
-(setq ar/helm-source-blog '((name . "Blog")
-                            (candidates . ar/get-helm-blog-candidates)
-                            (action . (lambda (candidate)
-                                        (helm-org-goto-marker candidate)
-                                        (org-show-subtree)))))
-
-(setq ar/helm-source-blog-bookmarks '((name . "Bookmarks")
-                                      (candidates . ar/get-helm-blog-bookmark-candidates)
-                                      (action . (lambda (candidate)
-                                                  (helm-org-goto-marker candidate)
-                                                  (org-show-subtree)))))
+(defvar ar/helm-source-blog '((name . "Blog")
+                              (candidates . ar/get-helm-blog-candidates)
+                              (action . (lambda (candidate)
+                                          (helm-org-goto-marker candidate)
+                                          (org-show-subtree)))))
 
 (defun ar/build-org-link ()
   "Build an org link, prompting for url and description."

    ;; Sets the option (Apple) key also as Meta.
    (setq mac-option-modifier 'meta)
    (setq exec-path (append exec-path '("~/homebrew/bin"
                                        "~/homebrew/Cellar/llvm/HEAD/bin")))))
(ar/init-for-osx)

(defun ar/init-for-linux ()

         `(:heading ,todo-heading :url ,(match-string 0 todo-heading)))
        (`(:heading ,todo-heading :marker ,(copy-marker (point))))))

(defun ar/org-helm-entry-child-candidates (path id)
  "Get org child headings for entry with PATH and ID."
  (with-current-buffer (find-file-noselect (expand-file-name path))
    (save-excursion
      (if (ar/current-buffer-match-p (format ":CUSTOM_ID:[ ]*%s" id))
          (progn
            (org-open-link-from-string (format "[[#%s]]" id))
            (org-end-of-meta-data-and-drawers)
            (let ((child-headings '())
                  (child-heading))
              (when (org-at-heading-p)
                ;; Extract first child.
                (setq child-heading (substring-no-properties (org-get-heading 'no-tags)))
                (add-to-list 'child-headings
                             (cons child-heading
                                   (ar/org-todo-heading-plist child-heading)))
                (while (org-get-next-sibling)
                  (setq child-heading (substring-no-properties (org-get-heading 'no-tags)))
                  (add-to-list 'child-headings
                               (cons child-heading
                                     (ar/org-todo-heading-plist child-heading)))))
              child-headings))
        (message "Cannot find %s#%s" path id)
        '()))))

(defun ar/todos-helm-candidates ()
  "Get this week's TODOS helm candidates."
  (ar/org-helm-entry-child-candidates "~/stuff/active/non-public/daily.org" "backlog"))

(defun ar/switch-to-file (file-path)
  "Switch to buffer with FILE-PATH."
