diff options
author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2021-01-10 10:43:41 +0100 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2021-01-16 06:00:22 +0200 |
commit | 1513ee37a4defbf1db7f26d1e8148843416dc987 (patch) | |
tree | 6cff7b15f02b4b440e4f0c90811915612d3c1593 /lisp | |
parent | 5d6817086d6485bc6e3dde054d877c0759656ddd (diff) | |
download | emacs-1513ee37a4defbf1db7f26d1e8148843416dc987.tar.gz emacs-1513ee37a4defbf1db7f26d1e8148843416dc987.tar.bz2 emacs-1513ee37a4defbf1db7f26d1e8148843416dc987.zip |
Change default-directory before prompting in project-compile
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.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/project.el | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 62c3cf44cb6..06966f33b72 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -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)) |