From: Philip K Date: Tue, 19 May 2020 17:30:14 +0000 (+0200) Subject: Add project-compile command X-Git-Tag: emacs-28.0.90~7317 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=babdd2e90e170bd99b7d3e3331fec14d31771a5a;p=emacs.git Add project-compile command * lisp/progmodes/project.el (project-compile): New function. --- 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