From 44f4ee000f6c4fb91f23dcd68583e0a8a0d837d1 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Mon, 20 Nov 2023 13:57:17 +0100 Subject: [PATCH] [emacs] Updates go-compile-commande --- .emacs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.emacs b/.emacs index c6a4a43..532331c 100644 --- a/.emacs +++ b/.emacs @@ -906,17 +906,19 @@ :after (projectile) :config (unbind-key "C-c C-d" go-mode-map) - (defun go-compile-command () + (defun atu/go-compile-command () "returns a string to compile a go project" - (setq project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile")) - (if (file-exists-p project-makefile) - "make" - "go build && go test && go vet" + (interactive) + (let ((project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile"))) + (if (file-exists-p project-makefile) + "make" + "go build && go test && go vet" + ) ) ) (projectile-update-project-type 'go - :compile 'go-compile-command) + :compile 'atu/go-compile-command) :hook (go-mode . lsp-deferred) (go-mode . (lambda ()