changeset 100456:e4798aef9a53

* epa-file.el (epa-file-insert-file-contents): Set buffer-file-name before decrypting a file.
author Daiki Ueno <ueno@unixuser.org>
date Wed, 17 Dec 2008 02:33:12 +0000
parents 61a8da68221a
children 022a6a6d35ab
files lisp/epa-file.el
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/epa-file.el	Wed Dec 17 02:32:48 2008 +0000
+++ b/lisp/epa-file.el	Wed Dec 17 02:33:12 2008 +0000
@@ -110,6 +110,8 @@
 	 (local-file (or local-copy file))
 	 (context (epg-make-context))
 	 string length entry)
+    (if visit
+	(setq buffer-file-name file))
     (epg-context-set-passphrase-callback
      context
      (cons #'epa-file-passphrase-callback-function
@@ -139,9 +141,8 @@
 	      (setq length (- (point-max) (point-min))))
 	    (if replace
 		(delete-region (point) (point-max)))
-	    (when visit
-	      (setq buffer-file-name file)
-	      (set-visited-file-modtime))))
+	    (if visit
+		(set-visited-file-modtime))))
       (if (and local-copy
 	       (file-exists-p local-copy))
 	  (delete-file local-copy)))