diff lisp/epa-file.el @ 100304:4dfef179eed3

* epa-hook.el (epa-file-find-file-hook): Don't mark the current buffer unmodified. (Bug#1509) * epa-file.el (epa-file-insert-file-contents): Set buffer's modification time if visiting a file and the content is successfully decrypted.
author Daiki Ueno <ueno@unixuser.org>
date Wed, 10 Dec 2008 01:35:39 +0000
parents cb5ef7767703
children e4798aef9a53
line wrap: on
line diff
--- a/lisp/epa-file.el	Wed Dec 10 01:04:19 2008 +0000
+++ b/lisp/epa-file.el	Wed Dec 10 01:35:39 2008 +0000
@@ -110,8 +110,6 @@
 	 (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
@@ -140,7 +138,10 @@
 	      (epa-file-decode-and-insert string file visit beg end replace)
 	      (setq length (- (point-max) (point-min))))
 	    (if replace
-		(delete-region (point) (point-max)))))
+		(delete-region (point) (point-max)))
+	    (when visit
+	      (setq buffer-file-name file)
+	      (set-visited-file-modtime))))
       (if (and local-copy
 	       (file-exists-p local-copy))
 	  (delete-file local-copy)))