branch: elpa/nix-mode
commit 236318101ef47d4a98f882175517a955635bdb47
Author: Matthew Bauer <[email protected]>
Commit: Matthew Bauer <[email protected]>

    Cleanup global-nix-mode
---
 nix.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/nix.el b/nix.el
index f6215b5be2..cb8fe452e8 100644
--- a/nix.el
+++ b/nix.el
@@ -87,21 +87,16 @@ ATTRIBUTE from PATH to get Nix expressions from."
                               nix-shell-executable
                               path attribute)))
 
-
 ;;;###autoload
 (define-minor-mode global-nix-mode
   "Minor mode to enable Nix enhancements."
   :require 'nix
   :global t
-  (cond
-   (global-nix-mode
+  (when global-nix-mode
     (add-to-list 'interpreter-mode-alist '("nix-shell" . nix-shebang-mode))
     (add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
     (add-to-list 'auto-mode-alist '("\\.drv\\'" . nix-drv-mode))
-    (add-hook 'nix-mode-hook (lambda () (setq-local company-backends 
'(company-nix))))
-    )
-   (t
-    ())))
+    (add-hook 'after-change-major-mode-hook 'nix-shell-mode)))
 
 (provide 'nix)
 ;;; nix.el ends here

Reply via email to