 (setq epa-file-cache-passphrase-for-symmetric-encryption t)
 (setq doom-theme 'doom-one-light)
 
-;; Launch debugger on error.
-;; (setq debug-on-error t)
-
 ;; ;; Org mode setup.
-
-;; ;;;; Window and frame manipulation for org workflow.
 
 (defadvice org-agenda-quit
     (after close-agenda-quickview)

(defun sa/clock-out ()
  (sa/local-shell-command "rm -f /tmp/org-clock-flag")
  (sa/notify "ORG CLOCK-OUT" (sa/task-clocked-time)))

;; (defun sa/switch-to-elfeed ()
;;   (interactive)
;;   (switch-to-buffer "*elfeed-entry*")
;;   )

;; (defun sa/org-todo-custom-date (&optional arg)
;;   "Like org-todo-yesterday, but prompt the user for a date. The time
;; of change will be 23:59 on that day"
;;   (interactive "P")
;;   (let* ((hour (nth 2 (decode-time
;;                        (org-current-time))))
;;          (daysback (- (date-to-day (current-time-string)) (org-time-string-to-absolute (org-read-date))))
;;          (org-extend-today-until (+ 1 (* 24 (- daysback 1)) hour))
;;          (org-use-effective-time t)) ; use the adjusted timestamp for logging
;;     (if (eq major-mode 'org-agenda-mode)
;;         (org-agenda-todo arg)
;;       (org-todo arg))))

;; ;; (defun sa/kill-org-buffers ()
;; ;;   (interactive)
;; ;;   (mapc (lambda (buffer)
;; ;;           (when (eq 'org-mode (buffer-local-value 'major-mode buffer))
;; ;;             (kill-buffer buffer)))
;; ;;         (buffer-list)))

(defun sa/search-org-agenda-headings ()
  "Widen and search through all org-mode agenda buffers."

  ;; Allow creating new nodes when refiling.
  (setq org-refile-allow-creating-parent-nodes 'confirm)

  (setq helm-org-rifle-close-unopened-file-buffers nil)
  ;; There seems to be a bug that hides the headline when path is shown.
  (setq helm-org-rifle-show-path nil)
  (setq helm-org-rifle-show-todo-keywords nil)

 ;; (setq org-contacts-files '("~/notes/people.org.gpg"))

  ;; Best-effort log CREATED timestamp.
  ;; Call (org-expiry-insert-created) to manually insert timestamps.
