From 6758110a251c27f17bc1f7edd23ba01dfceb62d1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 25 Jan 2020 17:06:47 -0500 Subject: [PATCH] Properly disable direnv when direnv-mode is disabled --- modules/tools/direnv/config.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/tools/direnv/config.el b/modules/tools/direnv/config.el index ae6ef6e3ec9..10a6a7681bc 100644 --- a/modules/tools/direnv/config.el +++ b/modules/tools/direnv/config.el @@ -17,9 +17,9 @@ when the file is first opened/major mode is activated. This is significantly less expensive, but is less sensitive to changes to .envrc done outside of Emacs." (direnv--disable) - (when direnv-mode - (add-hook 'after-change-major-mode-hook - #'direnv--maybe-update-environment)))) + (funcall (if direnv-mode 'add-hook 'remove-hook) + 'after-change-major-mode-hook + #'direnv--maybe-update-environment))) (defadvice! +direnv--make-process-environment-buffer-local-a (items) :filter-return #'direnv--export