From 510b229ee7bbc8efd3b170ff986803fd33960e82 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 11 May 2017 23:08:28 +0530 Subject: [PATCH] Emacs: Use (compile compile-command) instead of recompile --- .emacs.d/lisp/main.el | 2 +- .emacs.d/lisp/mode-go.el | 14 +++++++------- .emacs.d/lisp/mode-tex.el | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.emacs.d/lisp/main.el b/.emacs.d/lisp/main.el index 252ec690..2e7859ed 100644 --- a/.emacs.d/lisp/main.el +++ b/.emacs.d/lisp/main.el @@ -220,7 +220,7 @@ ;; Don't set these bindings in mickey as we might have to override them from ;; mode hooks. (global-set-key (kbd "C-") 'compile) -(global-set-key (kbd "") 'recompile) +(global-set-key (kbd "") (lambda () (interactive) (compile compile-command))) ; Do not use recompile since we want to change de compilation folder to the current buffer. (global-set-key (kbd "") 'previous-error) (global-set-key (kbd "") 'next-error) diff --git a/.emacs.d/lisp/mode-go.el b/.emacs.d/lisp/mode-go.el index 5f97d89b..165e7697 100644 --- a/.emacs.d/lisp/mode-go.el +++ b/.emacs.d/lisp/mode-go.el @@ -22,6 +22,13 @@ "-E gofmt") " ") "Additional arguments to pass to gometalinter.") +(defun go-metalinter (arg) + (interactive "P") + (let ((compile-command (format "gometalinter %s" gometalinter-args))) + (if arg + (call-interactively 'compile) + (compile compile-command)))) + (defun go-set-compile-command () "Set `compile-command' depending on the context. @@ -49,13 +56,6 @@ Note that the -cover test flag is left out since it shifts line numbers." (and looping (not (string= dir "/"))))) (if (string= dir "/") nil t)))) -(defun go-metalinter (arg) - (interactive "P") - (let ((compile-command (format "gometalinter %s" gometalinter-args))) - (if arg - (recompile t) - (compile compile-command)))) - (when (require 'go-guru nil t) (unless (executable-find "guru") ; Requires `call-process-to-string' from `functions'." diff --git a/.emacs.d/lisp/mode-tex.el b/.emacs.d/lisp/mode-tex.el index d7b8b094..da8eda4f 100644 --- a/.emacs.d/lisp/mode-tex.el +++ b/.emacs.d/lisp/mode-tex.el @@ -133,7 +133,7 @@ This does not interfere with `subword-mode'." ") ;; (set (make-local-variable 'use-hard-newlines) t) (local-set-key (kbd "") 'tex-pdf-view) - (local-set-key (kbd "") (lambda () (interactive) (progn (recompile) (sit-for tex-compilation-delay) (delete-windows-on "*compilation*")))) + (local-set-key (kbd "") (lambda () (interactive) (progn (compile compile-command) (sit-for tex-compilation-delay) (delete-windows-on "*compilation*")))) (tex-set-compiler))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;