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

    Don't save .dir-locals.el on user abort in projectile-edit-dir-locals
    
    unwind-protect ran save-buffer even when the user aborted skeleton
    insertion with C-g, creating a .dir-locals.el with empty/partial
    content. Run save-buffer sequentially after the skeleton instead,
    so aborting leaves no file on disk.
---
 projectile.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/projectile.el b/projectile.el
index eae6b32cac..8fccc9bd49 100644
--- a/projectile.el
+++ b/projectile.el
@@ -6268,9 +6268,8 @@ If the current buffer does not belong to a project, call 
`previous-buffer'."
   (let ((file (expand-file-name ".dir-locals.el" (projectile-acquire-root))))
     (find-file file)
     (when (not (file-exists-p file))
-      (unwind-protect
-          (projectile-skel-dir-locals)
-        (save-buffer)))))
+      (projectile-skel-dir-locals)
+      (save-buffer))))
 
 
 ;;; Projectile Minor mode

Reply via email to