aboutsummaryrefslogtreecommitdiff
path: root/projectile.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.dev>2026-02-28 10:44:09 +0200
committerBozhidar Batsov <bozhidar@batsov.dev>2026-02-28 10:51:37 +0200
commit71526c5cab539ac29ad0728149a452faf1ad94ee (patch)
treea5986d7e87f111f3b16d53c6d188a128f11d6267 /projectile.el
parent2cd6d01c8dccf6ce339f4ccd3372acec22bc2cd9 (diff)
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.
Diffstat (limited to 'projectile.el')
-rw-r--r--projectile.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/projectile.el b/projectile.el
index 6ddd367..efd0bc0 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'.