   "Create an org CUSTOM_ID from a TITLE."
   (replace-regexp-in-string " " "-" (downcase title)))
 
+(defun ar/current-buffer-match-p (re)
+  "Return t if RE matches current buffer. nil otherwise."
+  (re-search-forward re nil t))
+
 (defun ar/string-match-p (regex string)
   "Return t if REGEX matches STRING. nil otherwise."
   (if (string-match regex string) t nil))

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

(defun ar/org-helm-entry-child-candidates (id)
  "Get org child headings for entry with ID."
  (save-excursion
    (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)))

(defun ar/todos-helm-candidates ()
  "Get this week's TODOS helm candidates."
  (with-current-buffer (find-file-noselect (expand-file-name
                                            "~/stuff/active/non-public/daily.org"))
    (ar/org-helm-entry-child-candidates "backlog")))

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

    ;; 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"
                                        "/usr/local/bin")))))
(ar/init-for-osx)

(defun ar/init-for-linux ()
