[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: project-compilation-buffer-name-function and recompile
From: |
Jörg Bornemann |
Subject: |
Re: project-compilation-buffer-name-function and recompile |
Date: |
Fri, 19 Jan 2024 16:05:55 +0100 |
User-agent: |
Mozilla Thunderbird |
On 1/19/24 01:45, Dmitry Gutov wrote:
Alternatively, you could add around-advice to recompile which would
temporarily bind compilation-buffer-file-name-function.
Nice, thanks for the suggestion!
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?
The command could look like this:
(defun project-recompile (&optional edit-command)
(interactive "P")
(let ((compilation-buffer-name-function
project-compilation-buffer-name-function ))
(recompile edit-command)))
It probably doesn't deserve a default key binding in project-prefix-map,
but you could the same way to invoke it as you did with 'recompile'.
FWIW, I've filed this - as suggested by Eli - as bug#68570.
I agree that project-recompile wouldn't deserve a default key binding
since recompile doesn't have one.
TBF, whenever I need to do a recompile-y action, I usually switch to the
corresponding compilation buffer and press 'g'. That usually has the
same effect and doesn't require remembering an extra command.
That also works. It seems to be a common suggestion (for example [1])
though to key-bind recompile instead of switching to the compilation
buffer first.
Cheers,
Joerg
[1] https://www.masteringemacs.org/article/compiling-running-scripts-emacs