]> git.eshelyaron.com Git - emacs.git/commitdiff
Change default-directory before prompting in project-compile
authorKévin Le Gouguec <kevin.legouguec@gmail.com>
Sun, 10 Jan 2021 09:43:41 +0000 (10:43 +0100)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 16 Jan 2021 04:00:22 +0000 (06:00 +0200)
This causes command completion to work from the project root, letting
users complete top-level folders, make targets, etc (bug#45765).

* lisp/progmodes/project.el (project-compile): Simplify using
call-interactively, as done with project(-async)-shell-command.

lisp/progmodes/project.el

index 62c3cf44cb6cdf8cd709cf601c733e85fa7a5b6f..06966f33b722c29a7eacfaf824a81720eb02f109 100644 (file)
@@ -970,20 +970,11 @@ loop using the command \\[fileloop-continue]."
 (declare-function compilation-read-command "compile")
 
 ;;;###autoload
-(defun project-compile (command &optional comint)
-  "Run `compile' in the project root.
-Arguments the same as in `compile'."
-  (interactive
-   (list
-    (let ((command (eval compile-command)))
-      (require 'compile)
-      (if (or compilation-read-command current-prefix-arg)
-         (compilation-read-command command)
-       command))
-    (consp current-prefix-arg)))
-  (let* ((pr (project-current t))
-         (default-directory (project-root pr)))
-    (compile command comint)))
+(defun project-compile ()
+  "Run `compile' in the project root."
+  (interactive)
+  (let ((default-directory (project-root (project-current t))))
+    (call-interactively #'compile)))
 
 (defun project--read-project-buffer ()
   (let* ((pr (project-current t))