GNU bug report logs - #68570
29.1; recompile might not re-use project-compile's buffer

Previous Next

Package: emacs;

Reported by: Jörg Bornemann <foss <at> jbornemann.de>

Date: Thu, 18 Jan 2024 16:58:01 UTC

Severity: normal

Found in version 29.1

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Jörg Bornemann <foss <at> jbornemann.de>, 68570 <at> debbugs.gnu.org
Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer
Date: Mon, 22 Jan 2024 09:31:22 +0200
>>>> Although I'm thinking by now that it might be more consistent to have
>>>> a separate project-recompile command in addition to
>>>> recompile.
>>> I've pushed to master a new command called that (commit 0a07603ae8d), like
>>> discussed on the mailing list.
>> Shouldn't now 'g' in project buffers use 'project-recompile'?
>
> I don't know if it should - AFAICS 'M-x recompile' doesn't rename the
> current buffer, so it seems like the current behavior is already correct.

This patch would allow 'recompile' to use the renamed project compilation buffer:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index ab4504fa027..58bf2401dac 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1395,7 +1395,10 @@ project-compile
         (compilation-buffer-name-function
          (or project-compilation-buffer-name-function
              compilation-buffer-name-function)))
-    (call-interactively #'compile)))
+    (with-current-buffer (call-interactively #'compile)
+      (when project-compilation-buffer-name-function
+        (setq-local compilation-buffer-name-function
+                    project-compilation-buffer-name-function)))))
 
 (defun project-recompile (&optional edit-command)
   "Run `recompile' with appropriate buffer."

Then 'project-recompile' won't be needed anymore.




This bug report was last modified 98 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.