From ab41d9cdcad99b121b206b9aab56e9db387f669a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 24 Aug 2021 17:56:55 -0700 Subject: emacs: move function for go-mode-compile The function needs to be defined before we use it in the `use-package` for go-mode. --- emacs/custom/fcuny-prog.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'emacs') diff --git a/emacs/custom/fcuny-prog.el b/emacs/custom/fcuny-prog.el index 1c341e1..d291f5d 100644 --- a/emacs/custom/fcuny-prog.el +++ b/emacs/custom/fcuny-prog.el @@ -113,6 +113,12 @@ :config (add-hook 'makefile-mode-hook (lambda () (setq-local tab-width 2)))) + +(defun fcuny/setup-go-mode-compile () + (if (not (string-match "go" compile-command)) + (set (make-local-variable 'compile-command) + "go build -v"))) + (use-package go-mode :ensure t :hook ((before-save . lsp-format-buffer) @@ -137,11 +143,6 @@ :bind (:map puppet-mode-map ("C-c |" . puppet-align-block))) -(defun fcuny/setup-go-mode-compile () - (if (not (string-match "go" compile-command)) - (set (make-local-variable 'compile-command) - "go build -v"))) - (use-package compile :ensure nil :custom -- cgit 1.4.1