diff options
| author | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-03-04 17:33:30 +0200 |
|---|---|---|
| committer | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-03-04 21:43:10 +0200 |
| commit | 8f027305c20cf98677bf02c95b67ab31fdecdfd2 (patch) | |
| tree | 8402b11eb5afbd53fa2f7b8b76819f7ae1137fbf | |
| parent | 0a4c2222154daf3e715e41e8abdeaf280a9adc5a (diff) | |
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.
| -rw-r--r-- | projectile.el | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/projectile.el b/projectile.el index eae6b32..8fccc9b 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 |
