--- Begin Message ---
Subject: |
Add a project-compile command |
Date: |
Tue, 19 May 2020 20:24:48 +0200 |
Hi,
this patch adds a `compile' command for project.el. It's nothing fancy,
just sets the first directory of `project-roots' as `default-directory',
and then calls the regular compile.
The TODOs mention a `project-build' command, and from my interpretation,
this is a slimmed down version (hence the other name, but also because
it just called compile in a different environment).
--
Philip K.
>From d4aa98e6b01e95f50dc9c6ec02792d4fce542b22 Mon Sep 17 00:00:00 2001
From: Philip K <address@hidden>
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
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#41408: Add a project-compile command |
Date: |
Wed, 20 May 2020 02:02:04 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 19.05.2020 21:24, Philip K. wrote:
this patch adds a `compile' command for project.el
I've applied the patch, but moved the new command to the end.
Thanks!
--- End Message ---