Skip to content

Commit

Permalink
Load capture-templates using doct
Browse files Browse the repository at this point in the history
  • Loading branch information
tviti committed Nov 10, 2020
1 parent e46331b commit 9deaa96
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion config/org-config.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,23 @@
(,(org-agenda-files t) . (:maxlevel . 3))))

;; Load the capture templates
(require 'doct)

(defun tviti/org-insert-time-range (dt)
"Returns an active time range at point from now till DT minutes."
(let* ((date-input (org-read-date t t))
(date (format-time-string (cdr org-time-stamp-formats) date-input))
;; (shifted (concat (substring date 0 -1)
;; (format " +%sm" dt)
;; (substring date -1))))
(shifted (format-time-string (cdr org-time-stamp-formats)
(time-add date-input (seconds-to-time (* dt 60))))))
(format "%s--%s" date shifted)))

(let ((fn (concat org-directory "/capture-templates.el")))
(with-temp-buffer
(insert-file-contents-literally fn)
(setq org-capture-templates (eval (read (buffer-string))))))
(setq org-capture-templates (doct (eval (read (buffer-string)))))))

;; WORKAROUND:Incremental refile completion doesn't work with ivy-mode (see
;; https://github.com/abo-abo/swiper/issues/1254 and
Expand Down

0 comments on commit 9deaa96

Please sign in to comment.