From: Dmitry Gutov Date: Mon, 4 Jan 2016 04:07:56 +0000 (+0200) Subject: diff-hl-flydiff-create-revision: Use condition-case X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/6d973dc8a7a1cbb5efd1c6c967d3c9c7f58bf2cd diff-hl-flydiff-create-revision: Use condition-case Fixes #59 --- diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el index 53d31f749..a63bc06e4 100644 --- a/diff-hl-flydiff.el +++ b/diff-hl-flydiff.el @@ -105,19 +105,18 @@ the user should be returned." (if (file-exists-p automatic-backup) (rename-file automatic-backup filename nil) (with-current-buffer filebuf - (let ((failed t) - (coding-system-for-read 'no-conversion) + (let ((coding-system-for-read 'no-conversion) (coding-system-for-write 'no-conversion)) - (unwind-protect + (condition-case nil (with-temp-file filename (let ((outbuf (current-buffer))) ;; Change buffer to get local value of ;; vc-checkout-switches. (with-current-buffer filebuf (vc-call find-revision file revision outbuf)))) - (setq failed nil) - (when (and failed (file-exists-p filename)) - (delete-file filename))))))) + (error + (when (file-exists-p filename) + (delete-file filename)))))))) filename)) (defun diff-hl-flydiff-buffer-with-head (file &optional backend)