From dd9db4e318f309afa839e034ff0d152d4aed34f9 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 15 Jan 2020 22:13:18 +0000 Subject: [PATCH] Prefer direnv to manage ORG_DIRECTORY Instead of keeping this in my ~/.profile, I'm going to define it in .envrc. What I still don't know is how functions like `getenv` are supposed to interact with direnv. I suppose maybe they aren't? Right now, when I call `(getenv "DOTFILES")` from Emacs, it's `nil`, which I understand. Hopefully the more I use direnv, the more reasonable expectations I'll have. --- .envrc | 1 + configs/shared/.emacs.d/wpc/packages/wpc-org.el | 15 +++++++++++++++ configs/shared/.profile | 3 +-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.envrc b/.envrc index f95eed11e..dd1aa4496 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ export DOTFILES=~/dotfiles +export ORG_DIRECTORY=~/Dropbox/org diff --git a/configs/shared/.emacs.d/wpc/packages/wpc-org.el b/configs/shared/.emacs.d/wpc/packages/wpc-org.el index 674354097..fb270336e 100644 --- a/configs/shared/.emacs.d/wpc/packages/wpc-org.el +++ b/configs/shared/.emacs.d/wpc/packages/wpc-org.el @@ -6,6 +6,20 @@ ;;; Code: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'prelude) +(require 'f) + +;; TODO: Define function like env/set? to handle this. +(prelude/assert (f-exists? (getenv "ORG_DIRECTORY"))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Configuration +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; TODO: figure out how to nest this in (use-package org ...) (setq org-capture-templates `( @@ -31,6 +45,7 @@ "* TODO %? ") )) + (evil-set-initial-state 'org-mode 'normal) (use-package org diff --git a/configs/shared/.profile b/configs/shared/.profile index 2f201c37d..57f87751b 100644 --- a/configs/shared/.profile +++ b/configs/shared/.profile @@ -31,14 +31,13 @@ export RUST_SRC_PATH # TODO: Decide if clipmenu is compatible with EXWM. # Ensure clipmenu uses rofi instead of dmenu +# TODO: Remove this after fully supporting Emacs client for clipmenu. export CM_LAUNCHER=rofi # Application configuration export FZF_DEFAULT_COMMAND='fd --hidden --follow --exclude ".git"' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" -export ORG_DIRECTORY="$HOME/Dropbox/org" - # Prevent compton from fading to the lock screen. This also prevents the white # overlay that compton was causing to appear. Still unsure why that was # happening.