diff options
| author | Philip K | 2020-05-19 19:30:14 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2020-05-20 02:07:01 +0300 |
| commit | babdd2e90e170bd99b7d3e3331fec14d31771a5a (patch) | |
| tree | ba9d56b39187e13eec571a9fc40319561e03e0fb | |
| parent | 3c2624e18826d9466eff13524b43903b781ada91 (diff) | |
| download | emacs-babdd2e90e170bd99b7d3e3331fec14d31771a5a.tar.gz emacs-babdd2e90e170bd99b7d3e3331fec14d31771a5a.zip | |
Add project-compile command
* lisp/progmodes/project.el (project-compile):
New function.
| -rw-r--r-- | lisp/progmodes/project.el | 12 |
1 files changed, 12 insertions, 0 deletions
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]." | |||
| 681 | from to (project-files (project-current t)) 'default) | 681 | from to (project-files (project-current t)) 'default) |
| 682 | (fileloop-continue)) | 682 | (fileloop-continue)) |
| 683 | 683 | ||
| 684 | ;;;###autoload | ||
| 685 | (defun project-compile () | ||
| 686 | "Run `compile' in the project root." | ||
| 687 | (interactive) | ||
| 688 | (let* ((pr (project-current t)) | ||
| 689 | (roots (project-roots pr)) | ||
| 690 | ;; TODO: be more intelligent when choosing a directory. This | ||
| 691 | ;; currently isn't a priority, since no `project-roots' | ||
| 692 | ;; implementation returns more that one directory. | ||
| 693 | (default-directory (car roots))) | ||
| 694 | (call-interactively 'compile))) | ||
| 695 | |||
| 684 | (provide 'project) | 696 | (provide 'project) |
| 685 | ;;; project.el ends here | 697 | ;;; project.el ends here |