branch: elpa/nix-mode commit 2de7d1d5852e935f37b84d76f3621284eba5c929 Author: Matthew Bauer <mjbaue...@gmail.com> Commit: Matthew Bauer <mjbaue...@gmail.com>
Don't require company to be installed. --- nix-mode.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nix-mode.el b/nix-mode.el index 8e1d309a7c..6e03e2635d 100644 --- a/nix-mode.el +++ b/nix-mode.el @@ -15,8 +15,6 @@ ;;; Code: -(require 'company) - ;; Emacs 24.2 compatability (unless (fboundp 'setq-local) (defmacro setq-local (var val) @@ -495,6 +493,10 @@ If a close brace `}' ends an antiquote, the next character begins a string." (when (featurep 'flycheck) (require 'nix-flycheck)) +(when (require 'company nil 'noerror) (add-to-list + 'company-backends + 'company-nix)) + ;;;###autoload (define-derived-mode nix-mode prog-mode "Nix" "Major mode for editing Nix expressions. @@ -547,11 +549,7 @@ The hook `nix-mode-hook' is run when Nix mode is started. (setq-local paragraph-start "[ \t]*\\(#+[ \t]*\\)?$") (setq-local paragraph-separate paragraph-start) - (easy-menu-add nix-mode-menu nix-mode-map) - - ;; Company - (add-to-list 'company-backends 'company-nix) - (company-mode)) + (easy-menu-add nix-mode-menu nix-mode-map)) ;;;###autoload (progn