emacs-devel
[Top][All Lists]
Advanced

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

project-compilation-buffer-name-function and recompile


From: Jörg Bornemann
Subject: project-compilation-buffer-name-function and recompile
Date: Wed, 17 Jan 2024 21:54:53 +0100
User-agent: Mozilla Thunderbird

Hi,

One can use project-compile to build a project and then call recompile
to repeat the compilation.  This reuses the buffer named
"*compilation*".

If I set project-compilation-buffer-name-function to
#'project-prefixed-buffer-name, this creates a compilation buffer
"*myproject-compilation*" when executing project-compile.  Now,
recompile won't re-use "*myproject-compilation*" but create a new
buffer "*compilation*".

To reproduce this behavior, it is enough to start Emacs like this:
$ emacs -Q --eval "(setq project-compilation-buffer-name-function #'project-prefixed-buffer-name)"

It would be nice if recompile could re-use project-compile's buffer name. I have fixed this locally by setting compilation-buffer-name-function like this:

---snip---
  (defun my-compilation-buffer-name (name-of-mode)
    (if (project-current)
(apply project-compilation-buffer-name-function (list name-of-mode))
      (compilation--default-buffer-name name-of-mode)))

  (setq compilation-buffer-name-function #'my-compilation-buffer-name)
---snap---

Although I'm thinking by now that it might be more consistent to have a separate project-recompile command in addition to
recompile.  What do you think?


Cheers,

Joerg



reply via email to

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