Skip to content

Commit

Permalink
Properly disable direnv when direnv-mode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
hlissner committed Jan 26, 2020
1 parent 8aec15c commit 6758110
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/tools/direnv/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6758110

Please sign in to comment.