From fbd05357f26ccd9d35a579d7e5ecd73cffa50114 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 19 Jul 2019 10:39:59 -0400 Subject: [PATCH] Pull environment vars from direnv into Cider repls --- emacs/init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 67b1601..18af486 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -2621,12 +2621,15 @@ The Emacs Multi-Media System. For libtag to work, libtag must be installed on th * Direnv [[https://direnv.net/][Direnv]] automatically runs bash scripts when you enter certain directories. This sets it up to work with Emacs: #+BEGIN_SRC emacs-lisp + (defun update-cider-env () + (direnv-update-directory-environment nrepl-project-dir)) + (use-package direnv :if (executable-find "direnv") :config (direnv-mode) (add-hook 'eshell-mode-hook #'direnv-update-directory-environment) (add-hook 'eshell-directory-change-hook #'direnv-update-directory-environment) - (add-buffer-mode-hook 'cider-repl-mode (lambda () (direnv-update-directory-environment nrepl-project-dir)))) + (add-buffer-mode-hook 'cider-repl-mode #'update-cider-env)) #+END_SRC * SQL Emacs has excellent built-in SQL support.