all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* project-compilation-buffer-name-function and recompile
@ 2024-01-17 20:54 Jörg Bornemann
  2024-01-18  5:30 ` Eli Zaretskii
  2024-01-19  0:45 ` Dmitry Gutov
  0 siblings, 2 replies; 5+ messages in thread
From: Jörg Bornemann @ 2024-01-17 20:54 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-21  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 20:54 project-compilation-buffer-name-function and recompile Jörg Bornemann
2024-01-18  5:30 ` Eli Zaretskii
2024-01-19  0:45 ` Dmitry Gutov
2024-01-19 15:05   ` Jörg Bornemann
2024-01-21  5:06     ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.