1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

project-recompile: Autoload and run in project root

* lisp/progmodes/project.el (project-recompile): Autoload and
use project root as `default-directory' (bug#74631).
This commit is contained in:
Daniel Mendler 2024-12-01 11:43:48 +01:00 committed by Dmitry Gutov
parent 4eea545bbc
commit be51f13491

View file

@ -1486,15 +1486,14 @@ If non-nil, it overrides `compilation-buffer-name-function' for
compilation-buffer-name-function)))
(call-interactively #'compile)))
;;;###autoload
(defun project-recompile (&optional edit-command)
"Run `recompile' with appropriate buffer."
(declare (interactive-only recompile))
(interactive "P")
(let ((compilation-buffer-name-function
(let ((default-directory (project-root (project-current t)))
(compilation-buffer-name-function
(or project-compilation-buffer-name-function
;; Should we error instead? When there's no
;; project-specific naming, there is no point in using
;; this command.
compilation-buffer-name-function)))
(recompile edit-command)))