org/org-capture: refactor; fix early autoloading

This commit is contained in:
Henrik Lissner 2017-10-02 20:00:01 +02:00
parent 8ce10af094
commit 4c148ea580
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 10 additions and 7 deletions

View file

@ -26,8 +26,7 @@ Uses the capture template specified by KEY. Otherwise, prompts you for one."
(window-system . ,(cond (IS-MAC 'ns) (window-system . ,(cond (IS-MAC 'ns)
(IS-LINUX 'x) (IS-LINUX 'x)
(t 'w32))) (t 'w32)))
,(when IS-LINUX ,(if IS-LINUX '(display . ":0")))
'(display . ":0")))
"TODO") "TODO")
;;;###autoload ;;;###autoload

View file

@ -1,5 +1,7 @@
;;; org/org-capture/config.el -*- lexical-binding: t; -*- ;;; org/org-capture/config.el -*- lexical-binding: t; -*-
(add-hook 'org-load-hook #'+org-capture|init t)
;; Sets up two `org-capture' workflows that I like: ;; Sets up two `org-capture' workflows that I like:
;; ;;
;; 1. The traditional way: invoking `org-capture' directly (or through a ;; 1. The traditional way: invoking `org-capture' directly (or through a
@ -20,9 +22,11 @@
(file+headline org-default-notes-file "Inbox") (file+headline org-default-notes-file "Inbox")
"* %u %?\n%i" :prepend t :kill-buffer t))) "* %u %?\n%i" :prepend t :kill-buffer t)))
(add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame) (defun +org-capture|init ()
(when (featurep! :feature evil) (add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame)
(add-hook 'org-capture-mode-hook #'evil-insert-state))
(when (featurep! :ui doom-dashboard) (when (featurep! :feature evil)
(add-hook '+doom-dashboard-inhibit-functions #'+org-capture-frame-p)) (add-hook 'org-capture-mode-hook #'evil-insert-state))
(when (featurep! :ui doom-dashboard)
(add-hook '+doom-dashboard-inhibit-functions #'+org-capture-frame-p)))