emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 6d973dc 02/10: diff-hl-flydiff-create-revision: Use condit


From: Dmitry Gutov
Subject: [elpa] master 6d973dc 02/10: diff-hl-flydiff-create-revision: Use condition-case
Date: Sun, 10 Jan 2016 15:47:42 +0000

branch: master
commit 6d973dc8a7a1cbb5efd1c6c967d3c9c7f58bf2cd
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    diff-hl-flydiff-create-revision: Use condition-case
    
    Fixes #59
---
 diff-hl-flydiff.el |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el
index 53d31f7..a63bc06 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]