From d4aa98e6b01e95f50dc9c6ec02792d4fce542b22 Mon Sep 17 00:00:00 2001 From: Philip K Date: Tue, 19 May 2020 19:30:14 +0200 Subject: [PATCH] Add project-compile command --- lisp/progmodes/project.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 44259990bb..15b5899140 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -590,6 +590,18 @@ project-read-file-name-function (function :tag "Custom function" nil)) :version "27.1") +;;;###autoload +(defun project-compile () + "Run `compile' in the project root." + (interactive) + (let* ((pr (project-current t)) + (roots (project-roots pr)) + ;; TODO: be more intelligent when choosing a directory. This + ;; currently isn't a priority, since no `project-roots' + ;; implementation returns more that one directory. + (default-directory (car roots))) + (call-interactively 'compile))) + (defun project--read-file-cpd-relative (prompt all-files &optional predicate hist default) -- 2.20.1