[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/plz 3b394c2b57 2/5: Fix: (plz) Don't delete pre
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/plz 3b394c2b57 2/5: Fix: (plz) Don't delete preexisting files |
Date: |
Sun, 14 Jan 2024 07:22:43 -0500 (EST) |
branch: externals-release/plz
commit 3b394c2b573e5bdf50b7ddab220cd2d7af48c6cb
Author: Joseph Turner <joseph@breatheoutbreathe.in>
Commit: Adam Porter <adam@alphapapa.net>
Fix: (plz) Don't delete preexisting files
---
plz.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/plz.el b/plz.el
index 8d4f7a5729..a5cc82ea07 100644
--- a/plz.el
+++ b/plz.el
@@ -449,6 +449,8 @@ NOQUERY is passed to `make-process', which see.
(progn
(write-region (point-min) (point-max) filename)
(funcall then filename))
+ (file-already-exists
+ (funcall then (make-plz-error :message (format "error
while writing to file %S: %S" filename err))))
;; In case of an error writing to the file, delete the
temp file
;; and signal the error. Ignore any errors encountered
while
;; deleting the file, which would obscure the original
error.
@@ -463,6 +465,8 @@ NOQUERY is passed to `make-process', which see.
(progn
(write-region (point-min) (point-max) filename nil nil nil
'excl)
(funcall then filename))
+ (file-already-exists
+ (funcall then (make-plz-error :message (format "error while
writing to file %S: %S" filename err))))
;; Since we are creating the file, it seems sensible to delete it
in case of an
;; error while writing to it (e.g. a disk-full error). And we
ignore any errors
;; encountered while deleting the file, which would obscure the
original error.