From: "Jörg Bornemann" <foss@jbornemann.de>
To: emacs-devel@gnu.org
Subject: project-compilation-buffer-name-function and recompile
Date: Wed, 17 Jan 2024 21:54:53 +0100 [thread overview]
Message-ID: <3474d4d5-5270-4cd4-94a2-efb9d24caa85@jbornemann.de> (raw)
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
next reply other threads:[~2024-01-17 20:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 20:54 Jörg Bornemann [this message]
2024-01-18 5:30 ` project-compilation-buffer-name-function and recompile Eli Zaretskii
2024-01-19 0:45 ` Dmitry Gutov
2024-01-19 15:05 ` Jörg Bornemann
2024-01-21 5:06 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3474d4d5-5270-4cd4-94a2-efb9d24caa85@jbornemann.de \
--to=foss@jbornemann.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.