# HG changeset patch # User Daiki Ueno # Date 1228872939 0 # Node ID 4dfef179eed3a72865e53f381beaa50101bdaa58 # Parent 3e044fa54e4f619c91e0fe3e7fcdddbceeaeda82 * 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. diff -r 3e044fa54e4f -r 4dfef179eed3 lisp/ChangeLog --- a/lisp/ChangeLog Wed Dec 10 01:04:19 2008 +0000 +++ b/lisp/ChangeLog Wed Dec 10 01:35:39 2008 +0000 @@ -1,3 +1,11 @@ +2008-12-10 Daiki Ueno + + * 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. + 2008-12-09 Chong Yidong * files.el (save-some-buffers): At each map-y-or-n-p iteration, diff -r 3e044fa54e4f -r 4dfef179eed3 lisp/epa-file.el --- 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))) diff -r 3e044fa54e4f -r 4dfef179eed3 lisp/epa-hook.el --- a/lisp/epa-hook.el Wed Dec 10 01:04:19 2008 +0000 +++ b/lisp/epa-hook.el Wed Dec 10 01:35:39 2008 +0000 @@ -79,8 +79,7 @@ (if (and buffer-file-name (string-match epa-file-name-regexp buffer-file-name) epa-file-inhibit-auto-save) - (auto-save-mode 0)) - (set-buffer-modified-p nil)) + (auto-save-mode 0))) (define-minor-mode auto-encryption-mode "Toggle automatic file encryption and decryption.