about summary refs log tree commit diff
path: root/configs/shared/.emacs.d/wpc
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-17T10·41+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-17T10·56+0000
commite197dc5aba1072b1f584453f9042d7c23e825318 (patch)
treeaba539d967dedc8707b8e1e8f82e2a768c1ee67b /configs/shared/.emacs.d/wpc
parent2108ee933a57b88267b6f2365e70d31dda50a57f (diff)
Re-enable wpc-org with direnv support
After moving some environment variables out of `~/.profile` and into a `.envrc`
file, I broke some of my modules because Emacs, which is started in
`~/.xsessionrc.shared`, is started from outside of the `.envrc` scope.

Thankfully someone wrote an excellent Emacs integration with `direnv` so now the
world keeps turning and it is even more beautiful than it was previously.
Diffstat (limited to 'configs/shared/.emacs.d/wpc')
-rw-r--r--configs/shared/.emacs.d/wpc/packages/wpc-misc.el5
-rw-r--r--configs/shared/.emacs.d/wpc/packages/wpc-org.el16
2 files changed, 10 insertions, 11 deletions
diff --git a/configs/shared/.emacs.d/wpc/packages/wpc-misc.el b/configs/shared/.emacs.d/wpc/packages/wpc-misc.el
index 0540b6251fb3..b78ccaaeab06 100644
--- a/configs/shared/.emacs.d/wpc/packages/wpc-misc.el
+++ b/configs/shared/.emacs.d/wpc/packages/wpc-misc.el
@@ -90,6 +90,11 @@
 ;; alternative to help
 (use-package helpful)
 
+;; Emacs integration with direnv
+(use-package direnv
+  :config
+  (direnv-mode))
+
 ;; Superior Elisp library for working with dates and times.
 ;; TODO: Put this where my other installations for dash.el, s.el, a.el, and
 ;; other utility Elisp libraries are located.
diff --git a/configs/shared/.emacs.d/wpc/packages/wpc-org.el b/configs/shared/.emacs.d/wpc/packages/wpc-org.el
index fb270336ec2f..7dfe94520261 100644
--- a/configs/shared/.emacs.d/wpc/packages/wpc-org.el
+++ b/configs/shared/.emacs.d/wpc/packages/wpc-org.el
@@ -12,9 +12,10 @@
 
 (require 'prelude)
 (require 'f)
+(require 'maybe)
 
-;; TODO: Define function like env/set? to handle this.
-(prelude/assert (f-exists? (getenv "ORG_DIRECTORY")))
+(prelude/assert (and (maybe/some? (getenv "ORG_DIRECTORY"))
+                     (f-exists? (getenv "ORG_DIRECTORY"))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Configuration
@@ -22,29 +23,22 @@
 
 ;; TODO: figure out how to nest this in (use-package org ...)
 (setq org-capture-templates
-      `(
-
-        ("w" "work" entry (file+headline
+      `(("w" "work" entry (file+headline
                            ,(f-join (getenv "ORG_DIRECTORY") "work.org")
                            "Tasks")
          "* TODO %?")
-
         ("p" "personal" entry (file+headline
                                ,(f-join (getenv "ORG_DIRECTORY") "personal.org")
                                "Tasks")
          "* TODO %? ")
-
         ("i" "ideas" entry (file+headline
                             ,(f-join (getenv "ORG_DIRECTORY") "ideas.org")
                             "Tasks")
          "* %? ")
-
         ("s" "shopping list" entry (file+headline
                             ,(f-join (getenv "ORG_DIRECTORY") "shopping.org")
                             "Items")
-         "* TODO %? ")
-
-        ))
+         "* TODO %? ")))
 
 (evil-set-initial-state 'org-mode 'normal)