summaryrefslogtreecommitdiff
path: root/lisp/epa-file.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@unixuser.org>2008-12-10 01:35:39 +0000
committerDaiki Ueno <ueno@unixuser.org>2008-12-10 01:35:39 +0000
commit8e3efc87f39efa8a4bdfe6eb92190226c4302599 (patch)
tree6bb0bb5d1530fb2d79d3b814b03dbcb46be09960 /lisp/epa-file.el
parent2133e2d13894855f7c44f1dd2fe1e90f49991c51 (diff)
downloademacs-8e3efc87f39efa8a4bdfe6eb92190226c4302599.tar.gz
* 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.
Diffstat (limited to 'lisp/epa-file.el')
-rw-r--r--lisp/epa-file.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index abc5bde7277..968b22cc52b 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -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)))