emacs-devel
[Top][All Lists]
Advanced

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

Re: project-compilation-buffer-name-function and recompile


From: Eli Zaretskii
Subject: Re: project-compilation-buffer-name-function and recompile
Date: Thu, 18 Jan 2024 07:30:17 +0200

> Date: Wed, 17 Jan 2024 21:54:53 +0100
> From: Jörg Bornemann <foss@jbornemann.de>
> 
> 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?

Thanks, I think what you say makes a lot of sense.  I suggest to
submit a feature-request bug report using "M-x report-emacs-bug" with
these details, so we could track this request.  If you can suggest a
patch to implement these ideas, it would be even better.



reply via email to

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