diff lisp/epa-file.el @ 109544:197e874deb67

merge trunk
author Kenichi Handa <handa@etlken>
date Mon, 26 Jul 2010 13:29:08 +0900
parents 1eca4fd49be3
children 280c8ae2476d
line wrap: on
line diff
--- a/lisp/epa-file.el	Mon Jul 26 13:28:02 2010 +0900
+++ b/lisp/epa-file.el	Mon Jul 26 13:29:08 2010 +0900
@@ -143,11 +143,12 @@
 	     ;; when decryption failed (bug#6568).  See the place
 	     ;; where `find-file-not-found-functions' are called in
 	     ;; `find-file-noselect-1'.
-	     (make-local-variable 'epa-file-error)
-	     (setq epa-file-error error)
-	     (add-hook 'find-file-not-found-functions
-		       'epa-file--find-file-not-found-function
-		       nil t)
+	     (when (file-exists-p local-file)
+	       (make-local-variable 'epa-file-error)
+	       (setq epa-file-error error)
+	       (add-hook 'find-file-not-found-functions
+			 'epa-file--find-file-not-found-function
+			 nil t))
 	     (signal 'file-error
 		     (cons "Opening input file" (cdr error)))))
 	  (make-local-variable 'epa-file-encrypt-to)