From babdd2e90e170bd99b7d3e3331fec14d31771a5a 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 (project-compile): New function. --- lisp/progmodes/project.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 06e882b9f06..41e34a37507 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -681,5 +681,17 @@ loop using the command \\[fileloop-continue]." from to (project-files (project-current t)) 'default) (fileloop-continue)) +;;;###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))) + (provide 'project) ;;; project.el ends here -- 2.39.5