emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master babdd2e 2/2: Add project-compile command


From: Dmitry Gutov
Subject: master babdd2e 2/2: Add project-compile command
Date: Tue, 19 May 2020 19:07:17 -0400 (EDT)

branch: master
commit babdd2e90e170bd99b7d3e3331fec14d31771a5a
Author: Philip K <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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 06e882b..41e34a3 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]