emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/projectile df0ce61 2/3: [Add #1517] Add per-project compil


From: ELPA Syncer
Subject: [nongnu] elpa/projectile df0ce61 2/3: [Add #1517] Add per-project compilation buffer variable (#1702)
Date: Wed, 25 Aug 2021 02:57:39 -0400 (EDT)

branch: elpa/projectile
commit df0ce61506373f8af4c8472f71cdba56d004247f
Author: Kijima Daigo <norimaking777@gmail.com>
Commit: GitHub <noreply@github.com>

    [Add #1517] Add per-project compilation buffer variable (#1702)
---
 doc/modules/ROOT/pages/configuration.adoc |  7 ++-----
 projectile.el                             | 12 +++++++++++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/doc/modules/ROOT/pages/configuration.adoc 
b/doc/modules/ROOT/pages/configuration.adoc
index 8b9fee8..0c14988 100644
--- a/doc/modules/ROOT/pages/configuration.adoc
+++ b/doc/modules/ROOT/pages/configuration.adoc
@@ -449,14 +449,11 @@ This affects all commands built on top of 
`projectile--run-project-cmd` like:
 
 Normally, the buffers created by those commands would be shared (overwritten)
 between projects, but it's also possible to make the compilation buffer names
-project-specific. Currently, this requires that the user explicitly set:
+project-specific. This requires that the user set:
 
 [source,elisp]
 ----
-(setq compilation-buffer-name-function
-      #'projectile-compilation-buffer-name)
-(setq compilation-save-buffers-predicate
-      #'projectile-current-project-buffer-p)
+(setq projectile-per-project-compilation-buffer t)
 ----
 
 Both of these degrade properly when not inside a project.
diff --git a/projectile.el b/projectile.el
index bc2b800..276626d 100644
--- a/projectile.el
+++ b/projectile.el
@@ -753,6 +753,11 @@ It assumes the test/ folder is at the same level as src/."
   :group 'projectile
   :type 'boolean)
 
+(defcustom projectile-per-project-compilation-buffer nil
+  "When non-nil, the compilation command makes the per-project compilation 
buffer."
+  :group 'projectile
+  :type 'boolean)
+
 (defcustom projectile-after-switch-project-hook nil
   "Hooks run right after project is switched."
   :group 'projectile
@@ -4588,7 +4593,9 @@ The command actually run is returned."
          (default-directory (projectile-compilation-dir))
          (command (projectile-maybe-read-command show-prompt
                                                  command
-                                                 prompt-prefix)))
+                                                 prompt-prefix))
+         compilation-buffer-name-function
+         compilation-save-buffers-predicate)
     (when command-map
       (puthash default-directory command command-map)
       (ring-insert (projectile--get-command-history project-root) command))
@@ -4597,6 +4604,9 @@ The command actually run is returned."
                          (lambda ()
                            (projectile-project-buffer-p (current-buffer)
                                                         project-root))))
+    (when projectile-per-project-compilation-buffer
+      (setq compilation-buffer-name-function 
#'projectile-compilation-buffer-name)
+      (setq compilation-save-buffers-predicate 
#'projectile-current-project-buffer-p))
     (unless (file-directory-p default-directory)
       (mkdir default-directory))
     (projectile-run-compilation command use-comint-mode)



reply via email to

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