branch: elpa/projectile
commit 71526c5cab539ac29ad0728149a452faf1ad94ee
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Remove unnecessary temp buffer in projectile--cache-project-commands-p
    
    The function created a temp buffer and ran hack-dir-local-variables
    on every compile/test/run invocation just to read a variable that
    dir-locals already set buffer-locally in file buffers. Simply read
    the variable directly.
---
 projectile.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/projectile.el b/projectile.el
index 6ddd367a2d..efd0bc0d28 100644
--- a/projectile.el
+++ b/projectile.el
@@ -5203,10 +5203,11 @@ Should be set via .dir-locals.el.")
 (put 'projectile-project-enable-cmd-caching 'safe-local-variable #'booleanp)
 
 (defun projectile--cache-project-commands-p ()
-  "Whether to cache project commands."
-  (with-temp-buffer
-    (hack-dir-local-variables-non-file-buffer)
-    projectile-project-enable-cmd-caching))
+  "Whether to cache project commands.
+The variable `projectile-project-enable-cmd-caching' is typically
+set via .dir-locals.el, which applies it buffer-locally in file
+buffers."
+  projectile-project-enable-cmd-caching)
 
 (defvar projectile-project-configure-cmd nil
   "The command to use with `projectile-configure-project'.

Reply via email to