d
(defun my-compilation-buffer-name (mode)
"Prefix MODE with current project name if any.
Intented to use as `compilation-buffer-name-function'."
(let ((project (project-current))
dash project-name)
(when project
(setq dash "-"
project-name (file-name-nondirectory (directory-file-name (project-root (project-current))))))
(concat "*" project-name dash (downcase mode) "*")))
(setq compilation-buffer-name-function #'my-compilation-buffer-name)